Urgent.News

What's breaking now, across thousands of outlets.

Tech

I replaced a paid pomodoro app with a 300-line Python script

Most pomodoro apps gate your own history behind a paywall. Marinara and Focus To-Do (among others) only keep a month of data on the free tier. I wanted to actually analyze months of tracked time, not lose it after four weeks. On top of that, I track dates on the Persian (Jalali) calendar, which none of the existing tools support at all. So I wrote my own. First pass was a function in a Jupyter…

The author grew tired of paying for pomodoro apps that only stored a limited amount of data. They required a solution that could analyze extensive tracked time data, including dates on the Persian (Jalali) calendar, which existing tools did not support. To address these needs, the author created their own Python script. Initially, a simple function logged start and end events to a CSV file, but this proved impractical due to the need for manual intervention each time a task was logged.

The second iteration transformed the script into a command-line interface (CLI), allowing commands like "pomo start coding" and "pomo end" to log tasks to a CSV file. Each session was recorded as a separate row with fields for UUID, date, weekday, task, start and end times, and duration. The script maintained a single source of truth through the CSV file, as there was no retained state between command invocations.

The third version of the script incorporated a calendar toggle, enabling users to switch between the Jalali and Gregorian calendars, with the latter being the default. The data model, commands, and aggregation logic remained consistent regardless of the calendar chosen. The complete script is available on GitHub.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 6 September →