Skip to main content

Python program that tracks total time spent on projects and saves sessions. It supports multiple projects.

Project description

⌛ HourTrack


Badge Workflow Badge License Badge Language Badge Pull Requests Badge Issues


Contents

📖 Description

💻 Windows, Linux and Mac compatible. 💻

A Python script to track time spent on various projects. This script allows you to start, stop, and monitor time tracking for different projects, as well as output data to files.

It is very lightweight since it doesnt have to be running in the background.

This script is going to help you track:

  • Total time spent on different projects
  • Work sessions information
  • Time spent on each session

🚀 Quick start

pipx install hourtrack
hourtrack start myProject

✨ Features

  • Supports multiple projects: Track time for multiple projects.
  • Start/Stop tracking: Start and stop tracking time for a project.
  • List projects: List all projects being tracked.
  • Delete project: Delete a project and all its data.
  • Reset project: Reset a project's data.
  • Export data: Export data to a .txt file.
  • ...

📦 Installation

From PyPI

pipx install hourtrack

pipx is optional but recommended, you can use pip instead.

Optional installation alternative

git clone https://github.com/P-ict0/HourTrack.git
cd HourTrack
pipx install .  # You can also use `pip`

📲 Usage

For help:

hourtrack --help

(Optional) Create a project: Create a project to start tracking time. (This is not necessary, as the project will be created when you start tracking time for it.)

hourtrack create <project>

Start tracking: Start tracking session for a project. If the project does not exist, it will be created.

hourtrack start <project>

Stop tracking: Stop current session for a project, saving the time spent. With option to delete all projects.

hourtrack stop <project|--all>

Reset project: Reset a project's data. With option to reset all projects

hourtrack reset <project|--all>

Edit project: Rename a project.

hourtrack edit <project> --rename <new_name>

Add session with endtime now that lasted certain number of hours.

hourtrack edit <project> --add-session <hours>

Delete session by its ID. (You get the id by hourtrack info <project>)

hourtrack edit <project> --delete-session <id>
# Delete last session
hourtrack edit <project> --delete-session -1

Delete project: Delete a project and all its data. With option to delete all projects.

hourtrack delete <project|--all>

List projects: List all/active projects.

hourtrack list <all|active> [--format <smart|full|short|hours>]

Project Info: Show the status of a specific project or show current active session. With option to output to a file.

# Project status
hourtrack info <project> [--format <smart|full|short|hours>] [-o <outputPath>]
# Active session
hourtrack info [--format <smart|full|short|hours>]

⚙ Options

Command Requirement Default Description
hourtrack --help None None For help
hourtrack create <project> Project name None Create a new empty project.
hourtrack start <project> Project name None Start tracking session for a project. If the project does not exist, it will be created.
hourtrack stop <project|--all> Project name or -a/--all flag None Stop current session for a project, saving the time spent. With option to stop all projects
hourtrack reset <project|--all> Project name or -a/--all flag None Reset a project's data. With option to reset all projects
`hourtrack edit <--rename |--add-session |--delete-session <id -1>>` One of --rename, --add-session, --delete-session None
hourtrack delete <project|--all> Project name or -a/--all flag None Delete a project and all its data. With option to delete all projects
hourtrack list <all|active> [--format <smart|full|short|hours>] format smart None List all/active projects.
hourtrack info [<project>] [--format <smart|full|short|hours>] [-o <outputPath>] format smart None Show the info of a specific project or show current active session if project is not specified. With option to output to a file.

💻 Development

git clone https://github.com/P-ict0/HourTrack.git
cd HourTrack
python -m venv venv
pip install -r requirements.txt
source venv/bin/activate # Windows: .\venv\Scripts\activate.ps1

# Run the script
python src/hourtrack.py --help

👥 Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your suggested changes.

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

hourtrack-1.6.0.tar.gz (49.0 kB view details)

Uploaded Source

Built Distribution

hourtrack-1.6.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file hourtrack-1.6.0.tar.gz.

File metadata

  • Download URL: hourtrack-1.6.0.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for hourtrack-1.6.0.tar.gz
Algorithm Hash digest
SHA256 f41a7082dcc37e81deda93bc126008d0c7528442ad175fa08ab90e1e5871fc5d
MD5 07e362a37df5aee2537f72f269de25c1
BLAKE2b-256 aee8e8c7946edec3bb420f3562c465359639974ad712381363f1339916a34f93

See more details on using hashes here.

File details

Details for the file hourtrack-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: hourtrack-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for hourtrack-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 461c322aaccb4722a344a6fca9f87857eb2a6aa3b44f52e9c356c1d43f221bff
MD5 c0998d1b657c11c2c8b9610528393238
BLAKE2b-256 a3bb4f1891ef205b49aa49d77480a038be1513e4d83f0411c34ae4cc72026bb0

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