Export TheBrain to Obsidian, a small script

While I love the concept of TheBrain (I’ve been trying to use it since its first release I think) it never clicked with me. So I wrote a small python script to export all the thoughts and make them available as markdown files. Pretty rough, but it works.

The converted files will contain the title of the thought, any notes and links to attachments. Jumps, parents and children are put at the bottom of the note.

So yeah, a lot of (manual) work is to be done after importing this into Obsidian, but it’s a start.

4 Likes

Thanks, Sander. I’ve also been a TheBrain User since around 2008 (I think). Obsidian flipped me by creating such a frictionless way to stay in my content. TheBrain’s Plex feels like it’s focal point, rather than my content. In Obsidian, my notes get center stage while I can still use the graph view for thinking about connections.

I could use some help getting started with your python script. I’ve set up GitHub Desktop, installed CodeRunner, and downloaded your file, and updated the file paths. I get the following error:

Traceback (most recent call last):
File “thebrain2markdown.py”, line 3, in
import html2markdown
ImportError: No module named html2markdown

Can you help me work through this? Thanks, and no worries if I’m asking too much. No is an acceptable answer. I don’t know if it matters, but I’m on MacOS Catalina.

[added] I found and downloaded a .js html2markdown file from GitHub. I’m not sure if this is what is needed, but as you might have guessed it didn’t make a difference. As you can tell, I’m not a programmer, though I was 30 years ago. TIA.

1 Like

I’m glad you asked, cause that way I can make the README a bit better. But I’ll answer your question here first.

Python needs certain modules (pieces of code written by others) to work. In this case html2markdown. The .js file you downloaded might be the same idea, but only for Javascript.

Since you’re on a Mac, you’ll need to install Python3 first (2.7 is installed by default). This guide can help with that:

After that, you install the module from a terminal with the command pip3 install html2markdown. Then run the script with python3 thebrain2markdown.py. If other modules are needed, you could install them the same way.

2 Likes

@Sander, Im on Windows 10 and have downloaded portable python (https://sourceforge.net/projects/portable-python/)
but have never used python.
Do I need to go and find the html2markup plugin to make your script work?
One week into Obsidian and I’m way over my head, but I dont care because I see it as the future.

I’m afraid I don’t know that distribution of Python. You need a command prompt to be able to install modules with pip. And I don’t see something like that in the screenshots. You could download one of the more official packages: https://www.python.org/downloads/windows/