Skip to main content

Command-line utility for tracking time spent on projects

Project description

Tracker Application

tracker is a simple command-line utility for tracking time spent on various projects. It allows you to start and stop sessions, view activity reports, list all projects, and delete projects.

Features

  • Start Session: Begin tracking time for a new or existing project.

  • Stop Session: End an active session for a project.

  • Report Activity: Get analytics for a specific project, including the number of sessions and total time spent.

  • List Projects: View all tracked projects.

  • Delete Project: Remove a project and all its associated sessions.

Installation

It is recommended to perform the installation with pipx. Run:

pipx install productivity-tracker

This will install the tracker command in an isolated environment.

Usage

The tracker command uses subcommands for different operations.

  1. Start a Session

    To start tracking time for a project:

    tracker start <project_name>
    
    • If <project_name> does not exist, it will be created.
    • If a session is already active for the specified project, an error will be raised.
  2. Stop a Session

    To stop the active session for a project:

    tracker stop <project_name>
    
    • An error will be raised if the project does not exist or if there is no active session for it.
  3. Report Activity

    To view analytics for a specific project:

    tracker report <project_name>
    
    • Shows the total number of sessions and the total time spent (in hours) on the project.
  4. List Projects

    To see all projects you are tracking:

    tracker list
    
    • Lists all project IDs and names, along with the total number of projects.
  5. Delete a Project

    To delete a project and all its associated sessions:

    tracker delete <project_name>
    
    • This action is irreversible. All session data for the project will be removed.

Database

The application uses an SQLite database named .projects.db, which will be created automatically in the home directory when you first run any tracker command.

The database schema includes two tables:

  • projects: Stores project names and their IDs.

    • id: INTEGER PRIMARY KEY
    • name: UNIQUE NOT NULL
  • sessions: Stores individual work sessions linked to projects.

    • id: INTEGER PRIMARY KEY
    • project_id: NOT NULL (Foreign Key referencing projects.id)
    • start: datetime NOT NULL
    • end: datetime (NULLable, indicates an active session)

Foreign key constraints with ON DELETE CASCADE are enabled, meaning that deleting a project will automatically delete all its associated sessions.

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

productivity_tracker-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

productivity_tracker-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file productivity_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: productivity_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for productivity_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 102809cfc26c8771091f5e0f8365426d10b74e05bd3f446e44994a3b49450073
MD5 ce241056d7c7130390b95ad4a0209e66
BLAKE2b-256 2583a8bc5e06dd70e74898d1c7e4ebbed6b2482327cc3ea28f7f82f70f9ddbb6

See more details on using hashes here.

File details

Details for the file productivity_tracker-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for productivity_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb434d1582b87a5abe07b085898f1168fdc04a8ca686688c1bb8be85e6dd5b1f
MD5 9cf74de7d2c67ebe7ec1c8ebbc37e2d4
BLAKE2b-256 d06138d2d83f3812bba8ff74f4926a25ef15292debcfe339f2e9a3b08532d215

See more details on using hashes here.

Supported by

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