This repository contains a set of Python scripts designed to help track work time on various projects efficiently. The app.py
script logs the start and end times of work sessions, manages AFK periods effectively, and the time_calculator.py
script calculates the total time spent on each project.
- Project Tracking: The
app.py
script logs work sessions for different projects, allowing for easy tracking of time spent on individual tasks. - AFK Handling: It detects and logs times when the user is away from the keyboard (AFK), ensuring these periods do not count towards the total work time.
- Dynamic Time Calculation: The
time_calculator.py
script provides functionality to calculate and display the total work time for each project, with options to specify the time calculation starting point (--since
parameter).
- Python 3.6 or higher
- Compatible with any operating system that supports Python and basic file operations.
Ensure Python is installed on your system. If not, download and install it from python.org.
-
Clone this repository or download
app.py
and any related files to your local machine. -
Open a terminal or command prompt.
-
Navigate to the directory containing
app.py
. -
Run the script using the following command:
python app.py
-
Follow the on-screen prompts to enter project names and tasks. Use the command
stop
to end the current project session orchange project
to switch to another project.
-
To run the time calculation independently, use the following command in the terminal where
time_calculator.py
is located:python time_calculator.py --since [day|midnight|YYYY-MM-DD HH:MM:SS]
Replace
[day|midnight|YYYY-MM-DD HH:MM:SS]
with your desired starting point for time calculation. If omitted, the script calculates time for the entire recorded period.
app.py
uses the Pythonlogging
library to create detailed logs of each work session in thetime_tracking.logs
file.time_calculator.py
reads these logs and processes them based on the specified--since
parameter to compute the total effective work time, excluding any AFK periods.
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request. If you encounter any issues or have suggestions for improvements, feel free to open an issue.
This project is open source and available under the MIT License.