Estimate how much time you've "wasted" writing code on GitHub — and what else you could have done with that time. Automatically generates a fun (or guilty!) STATS.md report based on your commit activity.
- Smart session estimation from GitHub commit history
- Weekly GitHub Action that updates
STATS.md - Modes:
fun,guilty,inspirational, andcorporate - CLI version available for local use
- GitHub template — easily clone and personalize
You have three options to get started depending on your preference:
Clone your version of the template:
git clone https://github.com/camadkins/codetime-waster.git
cd codetime-wasterRun the CLI tool:
python cli/codetime_waster.py --user yourgithub --repo yourrepo --mode fun-
Generate a config file:
python cli/codetime_waster.py --init --user yourgithub --repo yourrepo --mode guilty
-
Commit it:
git add codetime.config.yml git commit -m "Add my config" git push -
Go to GitHub → Actions → Manually run the job
-
Click "Use this template" (top of the repo)
-
In your new repo:
-
Add or edit
codetime.config.ymlin the GitHub UI:user: yourgithub repo: yourrepo mode: fun all: false
-
-
Commit the change to
main -
Go to Actions → Run the job
-
STATS.mdwill be generated and pushed automatically every Sunday 🎉
This repo includes a pre-configured GitHub Action that:
- Runs every Sunday at midnight UTC
- Executes the
main.pyscript - Reads
codetime.config.yml - Regenerates and commits your personalized
STATS.md
No maintenance needed.
Here’s what your STATS.md might look like:
# 📊 CodeTime Waster Report
**User**: `camadkins`
**Repos analyzed**: `codetime-waster`
**Estimated coding sessions**: `42`
**Total time wasted**: `21.0 hours` 😅
## 🌀 Instead, you could have:
- Cooked 42 healthy meals
- Hit the gym 21 times
- Watched 10 full baseball gamesWant to run it without cloning the whole repo? Download codetime_waster.py
Just run:
python codetime_waster.py --user yourname --repo yourrepopython cli/codetime_waster.py --user yourgithub --repo yourrepo --mode fun--user: Required: Your GitHub username.--repo: Optional: The specific GitHub repo to analyze. If not provided, and--allis not used, the program will not know which repo to analyze.--all: Optional: If this flag is used, the program will analyze all public repositories of the specified user.--mode: Optional: Choose the tone of the output. Available options:fun: Default, provides lighthearted alternatives for your wasted time.guilty: Gives you a more guilty perspective of how you could have used that time.inspirational: Offers motivational alternatives to your wasted time.corporate: Provides a corporate-like perspective (e.g., meetings, emails).
--init: Optional: Creates acodetime.config.ymlfile based on your input.--token: Optional: (Future feature) GitHub Personal Access Token (PAT) to increase the API rate limit (not implemented yet).
# Analyze one specific repo (default mode is 'fun')
python cli/codetime_waster.py --user yourgithub --repo yourrepo
# Analyze all repos for the user
python cli/codetime_waster.py --user yourgithub --all
# Use the 'guilty' mode
python cli/codetime_waster.py --user yourgithub --repo yourrepo --mode guilty- Fetches your commit timestamps via GitHub's API
- Groups them into "sessions" based on gaps
- Multiplies session count by average time (30 minutes)
- Shows you what else you could’ve done in that time 😅
GitHub's API has a rate limit that restricts the number of requests you can make:
- Unauthenticated users: 60 requests per hour
- Authenticated users: 5000 requests per hour (using a Personal Access Token)
- If you're only analyzing a few repos at a time, the limit will likely not be an issue.
- If you're analyzing many repos (especially in the
--allmode), you may hit the rate limit after several requests.
You can always wait for the limit to reset, or consider reducing the number of repos you're analyzing to avoid hitting the limit.
- Python 3.9+
requests,pyyaml
Install with:
pip install -r requirements.txtContributions welcome! Fork it, build your twist, and tag me.
MIT License • Made with 💻 by camadkins
If you enjoyed this project and want me to keep making more programs, consider buying me a coffee! ☕️
Every little bit helps, and I really appreciate it! 🙏