No ideas and a scripting problem
Published on Monday, 30. August 2021Another day, another post. And again, I have no idea what to write about. Well, that's not true. I have exactly one idea. Just one. I tried to come up with other ideas, which would make a better topic to write about. Usually, I can use something from the previous days to reflect on or use an idea I had for a longer time. Today, nothing spoke to me. And the only thing I paid attention to yesterday was thinking about is compartmentalisation. After finishing the post I wrote about this yesterday, I started to write a small python script to simplify the tracking and review of my time.
All you need to do to write such a script is to formalise the idea. In the case of compartmentalisation and time blocking, this means to be clear about what exactly I want to do and see when I'm reviewing and scheduling my week. After that, all I'm doing is writing an interface commands for each step (using argparse
) and some logic to serialise the data I'm tracking. Right now, I'm using .csv
sheets and pandas
, but I'll rewrite it to use SQL Alchemy
today.
These steps are standard for almost any project. Most of the code I wrote is boilerplate. If you worked on some of these projects before, it becomes straight forward to build. Nonetheless, there will always be a few interesting problems that you didn't anticipate before.
The way I currently planned the project means I will do a week review every sunday afternoon. This creates the problem when I'm going to reset the week. If Sunday is the first day of the week, the time before the week review isn't planned or tracked. If Sunday is the last day of the week, the time after the week review is unplanned. Therefore, Sunday should be the first and the last day of the week. This means, however, that I can't compute the calendar week from the date alone. An obvious solution is to store the associated calendar week in each tracked entry. Another solution is to just don't track the time on Sunday for now. Most of what I do on sunday is housekeeping anyway (meal prep, cleaning the flat, etc.) and the script is much more useful to control how I spend my time during the week. Every software project is full of those small decisions. That's what makes programming fun.