r/PythonLearning • • 5d ago

Showcase I built a Python tool that tracks my coding time on Windows without a start/stop timer

I wanted to know how much time I actually spend in my IDE. Leaving PyCharm open all afternoon doesn’t mean I coded for four hours, so I wrote a small Python tracker that runs in the background. It checks which window is in focus and pauses after 10 minutes of inactivity.

The first version sent daily totals to the Pixela API. For this version, I built a local dashboard with PySide6 and Matplotlib. I can open it at the end of the week, see my hours day by day, and compare them against a daily goal. The data stays on my PC, and the dashboard can stay closed while the tracker runs.

It tracks PyCharm, VS Code, Visual Studio, and IntelliJ IDEA by default. If you use another editor, you can add its .exe name to a JSON file. There’s also a demo mode if you want to try the dashboard before you’ve logged any time.

GitHub: Coding Tracker Dashboard

One trade-off I’m curious about: reading docs in a browser is often part of coding, but the tracker only counts time in the apps you choose. If you tracked your own coding time, would you want to include that, or would you find an IDE-only total more useful?

3 Upvotes

20 comments sorted by

2

u/Fluffy_white_fox 5d ago

That's soo cool and a nice way to track progress

1

u/TemperatureProper275 5d ago

The tracker tracks whatever app you are writing code for. Basically, you add the .exe name of your app and it tracks time when activity is detected in the app.

2

u/ilyashulga 4d ago

Yo, this project real cool and geniuses, I like it!

2

u/TemperatureProper275 4d ago

You can check it on my Github!

1

u/ilyashulga 3d ago

I've already looked a long time ago.

2

u/TemperatureProper275 2d ago

Yesterday i uploaded the two exe files if you want them.

1

u/TemperatureProper275 3d ago

Whoever wants to download just the two .exe application files now, there are on my Google Drive (link on GitHub)

Maybe you will have a screen showing you an untrusted .exe app and blablabla, it's because I uploaded them as plain .exe files and did not do anything to make them trustworthy before uploading them to the cloud

1

u/Martas-tech 5d ago

cool I love it

1

u/TemperatureProper275 5d ago edited 5d ago

It's a script, basically, you put the execution in the Startup folder and it runs every time the PC is booted up. I have it run for more than 3 months, the dashboard is a different app,not part of the tracker, and it only displays the data with visuals and graphs.

1

u/COLLLOrs 4d ago

You could package it all into an .exe file using pyinstaller, if you'd like to.

1

u/TemperatureProper275 3d ago

Yeah, I thought about it but back then I was brain-burned and let the code and the instructions on how to turn it into an exe file into the README file.

1

u/TemperatureProper275 3d ago

So, I tried to upload the two .exe files to GitHub, but the file size is larger than 60+mb. If anyone wants to have these two files and not compile them themselves, I will probably find out how to upload large files on Git, and if this takes more effort, I will upload them to the cloud with a link on GitHub.

1

u/COLLLOrs 2d ago

That makes sense.

0

u/[deleted] 5d ago

[removed] — view removed comment

1

u/TemperatureProper275 4d ago

In order to achieve the same functionality on web apps, you will either need to specify (every time) what your target tabs are to track or build an AI model that scans the users's web activity and searches if what he's working on is programming/coding related topics.

This Python script only tracks the time you are working on specified IDEs or even .exe apps (related to coding). Basically, it's run & forget. The dashboard is only there to visualize the output that the script produces.

0

u/[deleted] 4d ago

[removed] — view removed comment

1

u/TemperatureProper275 4d ago edited 4d ago

it will tell you exactly how much time you spent coding. For example, if you write for 2 minutes and wait for 10, this isn't 2 + 10 = 12, it will be 2 because the max idle is 10 minutes.

If your activity is on a specific IDE (or multiple, for example Pycharm and VScode) then it will only count if the activity is present there. It will not count anything outside of the specific IDES or .exe apps.

The scipt checks the activity you are doing on every .exe app.

If you are coding on WordPad, for example, you specify wordpad.exe

0

u/[deleted] 4d ago

[removed] — view removed comment

1

u/TemperatureProper275 4d ago edited 4d ago

Exactly. There are also mechanisms for this type of errors, don't worry. The extension is finished for more than 3 months, and as of today, with constant running on the backend, I have not faced any problems.