I wanted to convert entries that had pdfs or png images. Converting multiple journals, a feature DayOne added at some point, was also on my list. As was having extra metadata like weather and user activity. One thing leading to another the code was updated and I figured it might interest someone.
Thanks a lot @arnaudl, and of course @dcb, for the starting point!
I was working on a similar script to help a (potential) migration from DayOne to Obsidian when I found this thread (and a few others) on the forum.
I adapted the script a bit and added two features (among others) that someone else might find useful:
Replacing DayOne internal links to Obsidian links. I have a journal where I heavily linked entries with each other, so migrating these links was essential to me.
Merging entries with the same date instead of creating a new file with a character suffix.
Hi there, just wondering if you can assist me with this import from the JSON file to obsidian. I have no experience with Python and to be honest very little experience with executing anything via terminal. I have installed Python but donāt know how to run your script. Do you mind giving me a quick outline how to run this please? Appreciate your help and time. Cheers
Sure I can help you, perhaps I can record a short screencast on how to use the script. But Iām mostly using Linux and/or Mac OS, so if youāre a Windows user thatās slightly more complicated ā well, I have a Windows machine at home, but I would have to install Python as I donāt use it that often.
Besides that, there are a few things that the script could do better. I already corrected a few small bugs but I discovered some more. For example (but it might not apply to your case): DayOne exports multi-line code blocks in a strange way, and I havenāt pushed that fix yet.
I tried to use this script but I just keep getting āModuleNotFoundError: No module named ārichāā, though I have installed this module with pip. Is there something that I am missing? I am on macOS 12.3, with python 3.9.11 installed.
Well, thatās actually a bug I accidentally introduced: I forgot to update the dependencies when I added a module of the ārichā package to print a progress bar (pretty useless, Iād say).
I will think about this. Currently I have decided to keep separate files, since I am also transferring the Day One metadata to the front matter in Obsidian, which includes location (which might change during the course of a day) and gives me context when reading my note.
If I change my mind about this, I can still write a script later that merges files. Obsidian is absolutely fantastic regarding doing all kinds of edits or moves or renames outside of Obsidian and handles that very gracefully.
Iām trying to use your script to migrate from DayOne to Obsidian, and when running the script Iāve been getting this error
Traceback (most recent call last):
File "/Users/doug/Desktop/dayone-to-obsidian-main/import.py", line 165, in <module>
convert()
File "/Users/doug/Library/Caches/pypoetry/virtualenvs/migration-dayone-NbulI752-py3.11/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/doug/Library/Caches/pypoetry/virtualenvs/migration-dayone-NbulI752-py3.11/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/doug/Library/Caches/pypoetry/virtualenvs/migration-dayone-NbulI752-py3.11/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/doug/Library/Caches/pypoetry/virtualenvs/migration-dayone-NbulI752-py3.11/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/doug/Desktop/dayone-to-obsidian-main/import.py", line 143, in convert
process_journal(
File "/Users/doug/Desktop/dayone-to-obsidian-main/utils.py", line 239, in process_journal
extra_tags=extra_tags,
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'extra_tags' where it is not associated with a value
Iām not super familiar with Python or working inside a terminal, so itās likely that Iāve been doing something wrong! Any ideas what might be causing it? Any help is greatly appreciated
I would love to see a screencast on how to use this script. I know how to launch a python script, but I donāt know how to get this to work at all and I know Iām missing something.