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.
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:
- Launch an Open-File dialogue where you'll navigate to your Notion-Export.zip file
- Convert all Internal Links in your Notion pages to an Obsidian friendly markdown format
- 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.
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.
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.
If you haven't already, you'll need to export your content from Notion.
- From your Notion app, click the Settings & Members tab in the sidebar
- Find and click the Settings tab. Find the Export content section. Click the Export all workspace content button
- Select Markdown & CSV as Export Format and click the Export button
- Save the resulting .zip file to your computer
- Extract the .zip contents to a known location
- Make sure
N2O.py
andN2Omodule.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.
Time to import everything into Obsidian
- Place all the converted files into a directory of your choosing
- Open Obsidian and click the Vault Icon
- Select Open folder as vault
- Use the Select Folder window to navigate to the directory with your newly converted files
Enjoy the shift to Obsidian!