Hi guys, not sure if this would be useful to anyone else but I wrote a python script to generate summary pages from historical daily notes by entries under each header, including a table to summarise e.g. tracked habits.
Demo: If your daily entries are generated from a template with set headers and look something like this:
This might be useful if you have a template with set sections for your daily entries or use it âbullet journalâ style and would like to see all the entries you made for each section.
Thereâs an option to use full transclusion if you want to edit in the summary page (e.g. check to-dos) and have it reflected back on the original daily note, or just want easy backlink navigation which is always handy. You can turn this off if you just want a summarised diary entry for a prettier view.
You do have to run the python file to generate these summaries and wonât update automatically with new daily entries, but there are ways to automate the scripts to run every day (e.g. using crontab on mac), Iâve added an example bash script I use to do everything in one go.
I wrote this script for fun but maybe this functionality already exists and I just donât know about it - I only found out about Obsidian recently (loving it so far!) and donât know the full extent of the functionalities it offers. So if there is an âofficialâ way to look at summaries by header please do let me know since using that is probably better haha.
Some limitations:
I havenât tested this extensively (tested on URL and [[page links]]), feel free to play around and send PRs
Habit tracking only works for check boxes for now (but the code should be able to eventually adapt to habits tracked with numbers as well)
Code could definitely be refactored e.g. some hard-coding going on with string partitioning etc. (Iâm not experienced in handling html and markdown in pythonâŚ)
Known bugs (20/2/21): non-translusion display doesnât work properly if you have a # tag right after a bullet point.
Hi Iâm new in Obsidian and Python but I was able to run the script, itâs amazing thank you so much for sharing!
I have a suggestion/request: in the mood tracker is there a way to show the emoticon in each day cell instead of the tick mark? I use colours instead of emojis for my mood tracker so it would be cool to have in the summary a table that is completely coloured.
Hope I was clear. In the summary table instead of the tick, show the emoji for that day.
Hey! This is exactly what Iâm looking for. However, I have no idea about python and how to get this working - is there somewhere I can learn please? Thanks for your work.
I am not the OP but you should be able to get it running something like this:
Go to the Python website to get a Python installer. Install Python on your computer.
Python is a command-line program. Youâll need to follow the instructions at the OPâs linked github to run the python script. Youâll mostly be typing the commands they specify into a console program (such as âCommand Lineâ on a Windows PC; you can run Command Line from your Start Menu; you can type âcmdâ to find and open it).
I havenât tried running this myself (though Iâm interested); I just know that this is generally what youâll need to do.
So wanted to hopefully save some people from going down the wrong rabbit hole so hopefully this helps.
A) Python is not a command line program - it is an object-oriented programming language, in simplest of terms - Python is a diverse coding language that can do a lot of different stuff - from making a game to something simple like an automation script.
B) In light of A, we realize that it probably wonât be as simple as just downloading python onto your computer. What about which version? Is this compatible with the most recent python.10 or will you need to run an older version? When you download Python, it is not like downloading an app. You have to make sure Python is added to your path. (99% of people have 0 idea what anybody is talking about when you say âadd python to your pathâ)
btw, theyâve made it so you can click a box when installing to indeed add python to your path - but how would
anyone be aware of this?
C) In relation to this post and project (very cool btw) - you need to install 3 different dependencies, and to do that, well now we need to learn, âwhat the heck is âpipâ ?â
then you need to edit the python file, what are you going to edit the python file with?
Oh now letâs teach you about VsCode, or maybe you like Sublime Text, or maybe Atom? or Obsidian?
D) Working with GitHub - seems simple enough right? So everyone knows what a pull request is, forking a repo, cloning, etc etc.
Hopefully this clears up some questions, highlights why authors of these posts cannot possibly have the time to respond or even know where to begin on setting this up for someone with zero knowledge.
To be clear - none of this stuff is Nuclear Physics and is understandable but as you see - thereâs layers to this shit.
Looks great! Was curious if anyone knew of a way this could be done with Dataview? i.e. Dataview query that lists all strings under the similar headings in Daily Notes (assuming Daily notes are templated)
Possibly! Dataview works on an inline key-value system rather than âunder headingsâ. If youâre looking at things âunder headingsâ the built-in Obsidian search, for which you can embed queries in codeblocks like you can with dataview, may be more helpful!
For more specific guidance, you might try making a new thread explaining what your daily note template would look like and what pieces of it you are trying to query.
Thanks for the response! I was able to figure it out and will document it here in case it might help someone else:
I use a Daily Note template that has a section with the parameters I want to track in my âDashboard Noteâ. The section is setup like this:
HABITS
[Wake Early :: hh:mm]
[Gym :: ]
[Study :: ]
[Afternoon Walk :: ]
Then in my Dashboard Note, I have a dataview query as follows:
TABLE WITHOUT ID
link(file.name) as "Habit Log",
wake-early AS "đ¤ď¸",
gym AS "đď¸ââď¸",
study AS "đ",
afternoon-walk AS "đââď¸"
FROM "_Periodic/01 Daily"
SORT file.name DESC
LIMIT 10
WHERE file.name != "01 Daily"
Note that the parameter after FROM above should be the folder location of your Daily Notes. You can also edit the LIMIT number to however many rows you want the query to display.
Hope this helps someone implement a tabular habit tracker that pulls from Daily Notes thru Dataview!