Exposing the zettelkasten to the quantitative eye
As an interesting and fun learning project, I've written my first python script. And I love to share it with you. I've exposed The Archive to explorations of the quantitative eye. You can look into mine and look into your own archive.
If you are a coder, I know you have many other things on your busy schedules, but I'm asking if you'd take a couple of minutes to look at my coding attempt and offer whatever help you want. Even just pointing me where or what to look for would be a great help.
pip3 install pandas
pip3 install ploty
The phyton script calls a shell script. I want to combine the shell script into the python script but learning about converting actions is slow. Install these together in a test directory and set the "user variables" in both scripts to what is appropriate for your system. Then all that needs to run from the cmd line is
python3 graph1.py. This will NOT modify your archive in any way.
It plots graphs for your zettelkasten's word count, link count, and the number of zettel. It doesn't require Keyboard Maestro, Alfred, Hazel, or crontab/launchd. It does this all in one go. I think the value is you wouldn't look at these stats on a regular schedule. This script should run faster than it currently does. Do you have any tips for running this faster?
Please don't laugh too loudly at the code. At least not so loud as I can hear. I'm sensitive. I'm a beginner. But helpful, constructive criticism is welcome.
There are two scripts.
- a shell script that collects the data from the zettelkasten
- needs to be set executable with
chmod +x statshistory.sh
- it has problems in that it increments past the end of each month, 30 to 99, and depending on the size of your zettelkasten, multiple years of months this takes a lot of time where no data is collected
- the time values running this script on 2278 zettel is
time sh statshistory.sh real 9m12.950s user 3m34.750s sys 6m6.445s
- a smaller subset of one's archive could be graphed to focus time
- my first python script that produces simple graphs (see below)
pip install plotlyand
pip install panda
- I'd like to find a way to prompt the user for variables (the zettelkasten location, beginning UUID, and ending UUID)
- calls the shell script
- reads temp.csv
- each line represents a day
- ploty is a very cool plugin and available in many environments
It looks like you're new here. If you want to get involved, click one of these buttons!