Skip to main content

⌛ 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
  • Set a goal for each project

🚀 Quick start

pip install hourtrack
hourtrack start myProject

✨ Features

  • Supports multiple projects: Track time for multiple projects.
  • Set goals: Set an hour goal for each project.
  • 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

pip install hourtrack

Optional installation alternative

git clone https://github.com/P-ict0/HourTrack.git
cd HourTrack
pip install .

You can now run Hourtrack with one of these 2 commands:

hourtrack
ht

📲 Usage

Help!

hourtrack --help
hourtrack <command> --help

Initialize a project

Create a project to start tracking time. You can also initialize a project with a goal.

hourtrack init <project>                  # Create a new empty project
hourtrack init <project> --goal <hours>   # Create a new project with a goal

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> # Stop tracking for a project
hourtrack stop --all     # Stop tracking for all projects

Reset project

Delete all sessions for a project or all projects and reset the timer to 0, but don't delete

hourtrack reset <project> # Reset a project
hourtrack reset --all     # Reset all projects

Edit project

hourtrack edit <project> --rename <new_name>    # Rename a project

hourtrack edit <project> --goal <hours>         # Set/edit an hour goal for a project (or remove it with 0)

hourtrack edit <project> --add-session <hours>  # Add a session to a project 
                                                # ending now that started <hours> hours ago.

hourtrack edit <project> --delete-session <id>  # Delete session by its id (use `info` command to get the id)
hourtrack edit <project> --delete-session -1    # Delete last session

Delete project

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

hourtrack delete <project> # Delete a project
hourtrack delete --all     # Delete all projects

List projects

List all/active projects.

Available formats: smart, full, short, hours. Note: If not specified, smart format is the default format.

hourtrack list all [-f <format>]      # List all projects
hourtrack list active [-f <format>]   # List active projects

Project Info

Show the status of a specific project or of all projects. With option to output to a file.

Available formats: smart, full, short, hours. Note: If not specified, smart format is the default format.

hourtrack info <project> [-f <format>]                      # Show project info
hourtrack info --all [-f <format>]                          # Show current active session info
hourtrack info <project|-all> -o <outputPath> [-f <format>] # Output to a file

⚙ Options

Command Requirement Default Description
hourtrack --help None None For help
hourtrack init <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 <project> <--rename <name>|--add-session <hours>|--delete-session <id|-1>|-g/--goal <hours>> One of --rename, --add-session, --delete-session, -g/--goal None Renames a project, edits hour goal, adds a session or deletes a session
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> [-f <smart|full|short|hours>] None format smart List all/active projects.
hourtrack info [<project>] [-f <smart|full|short|hours>] [-o <outputPath>] None format smart 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

# Note: You probably will need to remove the line from `utils/argument_parser.py`: from importlib.metadata import version
# And also remove the `version` option from the parser (below in the file).

# 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.

Metadata

Release files for hourtrack 1.7.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hourtrack 1.7.6
File Size Uploaded
hourtrack-1.7.6.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hourtrack 1.7.6
File Interpreter ABI Platform
hourtrack-1.7.6-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / hourtrack-1.7.6.tar.gz

Download URL hourtrack-1.7.6.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1dec79be896c8b3e187a5703955743c9286bdc8219a92959130be3064336ac2d
BLAKE2b-256 checksum
How to use checksums
22b3395999577ef43bf68ba0ce744a3f8f4c2e7c17f3363eb7041d85567dc4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / hourtrack-1.7.6-py3-none-any.whl

Download URL hourtrack-1.7.6-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f531c7199d2b10985fcee7d3cdd3c3a0de11025b35e52e0546009f559e85fe35
BLAKE2b-256 checksum
How to use checksums
5b6d9a51fd893561c7cf2b19e860172633b709398f02213f1285be648176d5d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

1.7.6 This release

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page