#productivity #python #postgres
Github repository for this project.
I use Obsidian to write down notes and my journal in markdown format. The app allows me to create relational notes. I can link these notes to each other, graph this relationship and use tags or dosens of plugins to make sense of my notes. But I always felt I needed to see more patterns and connections. And what is a better tool than Python to achieve this?
There is an Obsidian plugin which makes it easy to send the metadata (YAML) of each file to PostgreSQL database. From there on I can connect to the database and analyse my journal entries with Python. Here is my brief workflow:
The steps in Python are briefly:
%sql postgresql://username:password@host:port/database
query = โโโ SELECT dataview_data -> โdateโ as date, dataview_data -> โtagsโ as tags, dataview_data -> โmoodโ as mood, dataview_data -> โgeomโ as geom FROM obsidian.file; โโโ
df = pd.read_sql(query, engine)
To reveal further connection between the notes, one can even use dataframe.corr() function to see the correlation between metadata fields. This can help answer questions like โDo I feel better on the days where I have a walk?โ.
I know there is a lot of benefit of keeping a hand written journal. But I need to be able to analyse the information that Iโm documenting. Sending data to PostgreSQL and then to Python proved to be a very efficient way to do this