Code Monkey home page Code Monkey logo

notion-2-obsidan's Introduction

About this Fork

While running the script by visualcurrent, I have noticed that the UID was not removed from the files and folders automatically. Arozx has fixed this issue in his fork, however it was not compatible with macOS as the paths were preconfigured. This is why I have removed the preconfiguration, so the user can use the path of choice.

Also, the headings were doubled as the first line also contained the heading with a "#", which I did not like. This is why I have excluded the first line in this script.

Please note that the .zip file generated by Notion contains another .zip file nested inside it. Please extract the .zip file that is inside first and then run this script on it.

Notion-2-Obsidian

For those considering switching from Notion to Obsidian, here is a Python 3 script that converts your Notion export into an Obsidian friendly format.

When you run the N2O.py script, it will:

  1. Launch an Open-File dialogue where you'll navigate to your Notion-Export.zip file
  2. Convert all Internal Links in your Notion pages to an Obsidian friendly markdown format
  3. Repackages all the files into a new zip archive that is Obsidian vault compatible

The script will leave your orginal Notion archive unmodified.

The resulting archive can be extracted and opened as, or added to, an Obsidian vault.

The Problem with your Notion Export

Out of the box, the export files that Notion provides do not migrate to Obsidian very well. All external links will work, but:

  • The hierarchical structure of your pages can only be navigated using Obsidian’s file explorer.
  • None of the internal navigation links work, which also means there won’t be any backlinks or connections in Obsidian's Graph View.
  • None of the content in your Notion tables will be viewable.
  • Embedded images also won’t show.

All of this is remedied by this script. Note however, that Notion comments do NOT appear to be included in their export files.

Methodology

If you're interested, the full sequence of modifications needed to make your Notion export compatible with Obsidian can be found in the write-up found in the Methodology.md file in this git.

Export Your Full Notion Database

If you haven't already, you'll need to export your content from Notion.

  1. From your Notion app, click the Settings & Members tab in the sidebar
    Settings&Members
  2. Find and click the Settings tab. Find the Export content section. Click the Export all workspace content button
    Settings
  3. Select Markdown & CSV as Export Format and click the Export button
    Export
  4. Save the resulting .zip file to your computer
  5. Extract the .zip contents to a known location

Run the N2O.py Script

  • Make sure N2O.py and N2Omodule.py are in the same directory.
  • Run python3 N2O.py -i /path/to/your/zip/file/with/zip/extension.zip
  • When the script finishes you'll find a new zip file in the same directory that's ready for Obsidian.

Importing or Integrating into Obsidian

Time to import everything into Obsidian

  1. Place all the converted files into a directory of your choosing
  2. Open Obsidian and click the Vault Icon vault icon
  3. Select Open folder as vault
    open vault
  4. Use the Select Folder window to navigate to the directory with your newly converted files

Enjoy the shift to Obsidian!

notion-2-obsidan's People

Contributors

visualcurrent avatar omegakid1902 avatar jxpd avatar zsrobinson avatar

Forkers

yougnut

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.