Skip to main content

time-tracker-cli is a Python script that allows you to track the time spent working in your projects or tasks.

Project description

It's a Python script that allows you to track the time spent working in your projects or tasks. At the moment, this script doesn't have external dependencies so it's ready to run.

How to use:

Help menu:

$ python time_tracker_cli.py -h

usage: time_tracker_cli.py [-h] [-p PATH] [-r] project

positional arguments:
  project               project name

optional arguments:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  Path to the JSON data file
  -r, --report          Calculate and display a report of the time spent in the project

Start/end working session:

$ python time_tracker_cli.py "my_project" "~/Documents/my_project_time_tracker_data.json"

The file or project within the file will be created automatically if it doesn't exist.

Behavior

The script saves "timestamps" for the working sessions in a JSON file with the following structure:

{
   "projects": [
       {
           "project_name": "a_project_name",
           "sessions": [
              {
                  "start": "dd/mm/yy - H:M:S" ,
                  "end": "dd/mm/yy - H:M:S"
              }
           ]
       }
   ]
}

Unfinished sessions will have a null value in the end field.

Report

To calculate the time spent working in a project, run:

$ python time_tracker_cli.py "my_project" -r

Time spent working on project: 'test'
1 day, 7:52:19
Ongoing sessions: True
Time spent in ongoing session: 0:04:10.492647

TODO:

  • [x] Add more functions to estimate the time spent working in a project (total, mean per day).
  • [x] Add an argument to request a "report" of the time spent working in a project.
  • [x] Add more documentation.
  • [x] Add a simple GUI (optional).
  • [ ] Define behavior for unfinished sessions.

GUI version

Check out Time Tracker GUI

Project details


Release history Release notifications

Download files

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

Files for time-tracker-cli, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size time_tracker_cli-0.0.1-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size time-tracker-cli-0.0.1.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page