Skip to main content

A pomodoro timer implemented as a Textual app

Project description

pomodorable

A pomodoro timer built using Textual.

Development work in progress.

Picture of a Pomodoro Timer

Screenshots

Screenshot animation

Using the Application

Modes

  1. Ready
    • Initial mode when the application starts.
    • Returned to when a session is finished or stopped.
  2. Running
    • Entered when the Start button is pressed.
    • Returned to when Extend or Resume is chosen in paused mode.
  3. Paused
    • Entered when the Pause button is pressed.
    • Ended by pressing Extend, Resume or Stop.

Display and Inputs

Times Display

  • Countdown display: Shows the time remaining in the current session.
  • Start Time display: Shows the Start time of the current session. When a session is not running it shows the current time.
  • End Time display: Shows the End time of the current session. When a session is not running it shows the current time plus the session length.

Settings Panel

  • Reset button: Resets the Countdown to the configured session length (default setting is 25 minutes).
  • +5, +1, -1, -5 buttons: Increment or decrement the Countdown by minutes.
  • ? (About) button: Open the About screen.
  • Settings button: Open the Settings screen.

Task Panel

  • Task description input box: A brief description of the task at hand (optional). Press the down arrow key to open a list of recently used descriptions to pick from.
  • Start button: Starts the session. Countdown begins. Time displays show Start and End times for the running session.

Pause Panel - Running

  • Pause button: Pause the running session.
  • Reason description input box: Disabled when running.

Pause Panel - Paused

  • Pause button: Disabled when paused.
  • Reason description input box: Enter the reason for pausing (optional). Press the down arrow key to open a list of recently used descriptions to pick from.
  • Extend button: Return to running. Add the paused duration to the end-time to complete the full session length time-on-task.
  • Resume button: Return to running. Resume the session from the current time. The pause duration is subtracted from the countdown, reducing the session's time-on-task.
  • Stop button: Finish the session now. Return to ready mode.

Timer Bar

  • Mimics the markings on a classic pomodoro (tomato-shaped) kitchen timer.
  • Shows the current countdown minute at the pointer.

Log Panel

  • Shows messages from the application with a timestamp.

About Screen

The About screen is a dialog box showing some information about the application.

  • Version number of the application.
  • GitHub button: Open the web browser and go to the source GitHub page.
  • File locations:
    • Data path shows the directory where the application's data is stored. Output files are written to different locations as configured in the Settings screen.
    • Configuration shows the full path to the application's configuration file.
  • Close button: Closes the dialog.

Settings Screen

The Settings screen is where you configure the application. It has the following settings:

  • Session Minutes: Initial Countdown setting on startup, finish, stop, or reset.
  • Running CSV Folder: Folder to which the file is written. The folder must already exist.
  • Running CSV File Name: Name to use for the output file (default is pomodorable-sessions.csv).
  • Daily CSV Folder: Folder to which the file is written. The folder must already exist.
  • Filter CSV Output: Exclude selected actions from the CSV output files (see Filters below).
  • Daily Markdown Folder: Folder to which the file is written. The folder must already exist.
  • Daily Markdown Heading: The Markdown heading to insert before the individual sessions. The heading can be any heading level (# Heading-text or ### Heading-text for example).
  • Daily Markdown Append-only: When enabled, the file must already exist. This is for the case where the file is initially created by another application (such as a Daily Note file created by Obsidian).
  • Filter Markdown Output: Exclude selected actions from the Markdown output files (see Filters below).
  • Log Retention Days: Number of daily log files to keep. This applies to the application's operational logs, not the session data.

Filters for CSV and Markdown output:

Settings screen CLI: --filters= Description
Finish F Exclude Finish actions.
Pause (all) P Exclude all Pause actions.
Pause (w/o Reason) R Exclude Pause actions with no reason noted.
Stop X Exclude Stop actions.

Outputs

Daily and Running CSV

The Daily CSV output is for a single day. The folder it is written to can be configured in the Settings screen. The name of the file is the current date as yyyy-mm-dd.csv (2024-04-30.csv, for example).

The Running CSV output spans multiple days (running vs daily). Both the folder, and file name, are configured in the Settings screen.

The following columns are in the CSV output files:

  • date: Date of the action.
  • act: Action code (see below). When exported via the --export-csv CLI option, Start actions will instead have the session number (daily sequence).
  • time: Time of the action.
  • task: Description of the task for Start actions, otherwise empty.
  • message: Message associated with the action. Varies depending on the action.
  • notes: Note associated with the action. Varies depending on the action.

Action codes:

  • S - Start
  • E - Extend (after Pause)
  • R - Resume (after Pause)
  • F - Finished session
  • X - Stopped session

Note: The format of the CSV output files is based on the layout of a spreadsheet the author uses to track pomodoro sessions (among other things). It is designed for easy copy and paste into that spreadsheet. It's likely not the layout someone else would choose.

Daily Markdown

The Daily Markdown output is designed to insert pomodoro sessions into a Daily Notes file in Obisdian.

If the Daily Markdown Append-only setting is enabled, the Daily Note file (expects YYYY-MM-DD.md) must already exist. This is for the case where a template is used for Daily Note files and you want that template to always be used to create the file. If sessions are completed before the file is created they will be included the first time a session finishes and the Daily Note file exists.

Data

Configuration File

The configuration file is pomodorable-config.toml and is stored in a folder named pomodorable under the user config folder for the operating system. Configuration settings are managed in the Settings screen. You should not need to directly edit this file.

Data File

The main data file is pomodorable-data.csv and is stored in a folder named pomodorable under the user data folder for the operating system.

Each action (or event) recorded by the application is written to this file.

The columns in the CSV file are:

  • version: The version of the CSV format.
  • date: The date of the action.
  • time: The time of the action.
  • action: The name of the action.
  • message: A message associated with the action.
  • duration: The duration of the action.
  • notes: Any notes associated with the action.

This file is not intended to be used directly (though being CSV format, that is easy to do). There are several output files that provide a log of pomodoro sessions for the user.

Log Files

Log files are also written to the pomodorable folder under the system's user data folder. Each log file is named with the current date. The number of files to keep is configured in the Settings screen.


Command-Line Usage

Usage: pomodorable [OPTIONS]

  Handle command-line options or run the Textual User Interface.

Options:
  --version           Show the version and exit.
  --csv-date TEXT     Export a Daily CSV file for a given date (provide the
                      date as YYYY-MM-DD or YY-MM-DD). If a 'Daily CSV Folder'
                      is not configured, then you must provide the --export-
                      path option as well. Existing files are not overwritten.
                      Exits when finished.
  --md-date TEXT      Export a Daily Markdown file for a given date (provide
                      the date as YYYY-MM-DD or YY-MM-DD). If a 'Daily
                      Markdown Folder' is not configured, then you must
                      provide the --export-path option as well. Existing files
                      are not overwritten. Exits when finished.
  --end-date TEXT     Export a range of sessions from the start date to the
                      end date (provide the dates as YYYY-MM-DD or YY-MM-DD).
                      This option is only valid with the --csv-date or --md-
                      date option.
  --export-path TEXT  Path to export a Daily CSV or Markdown file. This option
                      is required if a 'Daily CSV Folder' or 'Daily Markdown
                      Folder' is not configured, or you want the files written
                      to a different location.
  --filters TEXT      Filter specified actions from exported CSV data. The
                      filter is specified as a string with no spaces, where
                      each character represents a type of action to exclude.
                      The characters are: F (Finish), P (Pause - all), R
                      (pause w/o Reason), and X (Stop).
  -h, --help          Show this message and exit.

Reference

Packages used

  • Textual - Textual User Interface framework
  • Click - command-line options
  • platformdirs - common directories on different platforms
  • plyer - system notifications
  • python-dotenv - override default settings during development
  • tomlkit - store configuration as TOML

Project tools

  • Hatch - Python project manager (environments, packaging, and more)
  • Ruff - linter and code formatter (integrated with Hatch)
  • pytest - testing framework
  • Just - command runner

Textual Development Tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pomodorable-0.1.dev30.tar.gz (206.5 kB view details)

Uploaded Source

Built Distribution

pomodorable-0.1.dev30-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file pomodorable-0.1.dev30.tar.gz.

File metadata

  • Download URL: pomodorable-0.1.dev30.tar.gz
  • Upload date:
  • Size: 206.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.26.0

File hashes

Hashes for pomodorable-0.1.dev30.tar.gz
Algorithm Hash digest
SHA256 24663f21318ac99ac8e06fb0dddf0b4450f4f37061578319c67cc2bec3425179
MD5 7b2c67d9bc349ba375a024427154d00b
BLAKE2b-256 8504b58a0b80dc352786713f5e633d8c9f861aaaaf12b058e5fe39c1d2ba311e

See more details on using hashes here.

File details

Details for the file pomodorable-0.1.dev30-py3-none-any.whl.

File metadata

File hashes

Hashes for pomodorable-0.1.dev30-py3-none-any.whl
Algorithm Hash digest
SHA256 f620531dcaae31ec03c8f2e18029f619e109126d784bb3ee719106afdef81af5
MD5 556138e32c1c21caef6a20736c114898
BLAKE2b-256 09997fc9cef012ef3b1a7ff7f6d52228a599eaa0aabb409c01dcf1ba7752bd8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page