Retroactive Time Tracking Data Generator
Project description
๐ Wakatimer: Retroactive Time Tracking Simulator
Wakatimer is a Python-based CLI tool that simulates human-like coding behavior to generate realistic, retroactive time-tracking data. It's perfect for populating services like WakaTime with historical data for projects you worked on before you started time tracking.
Key Features
- Interactive Setup: A guided, interactive mode for easy configuration.
- Flexible Simulation Modes: Choose between automatic time estimation or manual duration specification.
- Project Templates: Pre-configured settings for common development workflows (e.g., web app, data science).
- Intelligent File Processing: Smart ordering of files based on type and dependencies, with realistic typing and delays.
- Resume Capability: Pause and resume long simulations without losing progress.
- Advanced Human-like Behavior: Simulates refactoring, debugging, research pauses, and even copy-paste actions.
- Comprehensive Analytics: Detailed session reports, language statistics, and productivity metrics with export options.
- Time Tracking Compatibility: Designed to respect common time-tracking application behaviors like grace periods.
Installation
Install Wakatimer directly from PyPI:
pip install wakatimer
Alternatively, for development, clone the repository and install in editable mode:
git clone https://github.com/sukarth/Wakatimer.git
cd Wakatimer
pip install -e .[dev]
Getting Started: First Simulation
Run your first simulation in interactive mode. This is the easiest way to get started, as it will guide you through all the required settings.
-
Run the interactive command:
wakatimer --interactive -
Follow the prompts:
- Select the source directory of the project you want to simulate.
- Choose a destination directory for the output.
- Pick a simulation mode (auto or manual).
- Enable or disable features like refactoring and testing cycles.
Wakatimer will then analyze your project, display an execution plan, and ask for confirmation before starting the simulation.
๐ Command Line Reference
wakatimer <source_dir> <dest_dir> [options]
Arguments:
source_dir Source directory containing your coding project
dest_dir Destination directory for the simulated project
Core Options:
--mode {auto, manual} Simulation mode (default: auto)
--hours HOURS Total coding hours for manual mode (supports decimals)
--interactive Enable interactive setup mode with guided configuration
Features:
--template NAME Use project template (web_app, data_science, custom)
--no-refactoring Disable refactoring phases
--no-testing Disable testing cycle simulation
--no-research Disable research pause simulation
--no-copy-paste Disable copy-paste speed simulation
--no-analytics Skip analytics generation and export
Advanced:
--grace-period SECONDS Grace period between content changes (default: 90)
--ignore PATTERN Ignore files/patterns (can be used multiple times)
--resume Resume previous session if available
๐ Project Templates
Pre-configured templates for different project types:
๐ Web Application (web_app.json)
- Optimized for: Frontend/Backend web development
- File priorities: Config โ Core JS/TS/Python โ Tests โ Docs
- Speed adjustments: Faster HTML/CSS, slower TypeScript
- Features: Higher refactoring probability, moderate debugging
๐ Data Science (data_science.json)
- Optimized for: ML and data analysis projects
- File priorities: Config โ Python/Jupyter โ Data files โ Docs
- Speed adjustments: Slower Python (complex algorithms), very slow Jupyter
- Features: High refactoring probability, high debugging probability
๐ฑ Mobile App (mobile_app.json)
- Optimized for: iOS/Android mobile development
- File priorities: Config โ Core โ UI โ Platform-specific โ Tests
- Speed adjustments: Slower Swift/Kotlin, faster XML/JSON
- Features: High debugging, moderate refactoring
๐ง Backend API (backend_api.json)
- Optimized for: REST APIs and microservices
- File priorities: Config โ Models โ Routes โ Middleware โ Tests
- Speed adjustments: Optimized for server-side languages
- Features: High refactoring, moderate debugging
๐ฎ Game Development (game_development.json)
- Optimized for: Video game development
- File priorities: Config โ Gameplay โ Graphics โ Audio โ UI
- Speed adjustments: Slower C++/C#, very slow shaders
- Features: High debugging, moderate testing
โ๏ธ DevOps & Infrastructure (devops_infrastructure.json)
- Optimized for: Infrastructure as Code, CI/CD
- File priorities: Config โ Infrastructure โ Containers โ Scripts
- Speed adjustments: Faster YAML/JSON, slower Terraform
- Features: High testing, moderate research
๐ฅ๏ธ Desktop Application (desktop_application.json)
- Optimized for: Cross-platform desktop apps
- File priorities: Config โ Core โ UI โ Components โ Resources
- Speed adjustments: Balanced for desktop frameworks
- Features: Moderate refactoring and debugging
๐ Cybersecurity (cybersecurity.json)
- Optimized for: Security tools and penetration testing
- File priorities: Tools โ Exploits โ Analysis โ Reports
- Speed adjustments: Slower assembly, faster scripting
- Features: High research, moderate debugging
๐ค Machine Learning (machine_learning.json)
- Optimized for: ML models and AI research
- File priorities: Notebooks โ Models โ Data โ Training โ Evaluation
- Speed adjustments: Slower Python/Jupyter, faster configs
- Features: High research, moderate refactoring
โ๏ธ Blockchain & Crypto (blockchain_crypto.json)
- Optimized for: Smart contracts and DeFi
- File priorities: Contracts โ Scripts โ Frontend โ Tests
- Speed adjustments: Very slow Solidity/Rust, faster JS/TS
- Features: High refactoring and testing
๐ Embedded & IoT (embedded_iot.json)
- Optimized for: Embedded systems and IoT devices
- File priorities: Config โ Drivers โ Firmware โ Protocols
- Speed adjustments: Very slow C/Assembly, moderate C++
- Features: High debugging, moderate research
Custom Templates
Create your own templates in templates/custom.json:
{
"name": "My Custom Template",
"description": "Custom project workflow",
"file_priorities": {
"config": ["*.json", "*.yml"],
"core": ["*.py", "*.js"],
"tests": ["*test*"],
"docs": ["*.md"]
},
"typing_speed_multipliers": {
"Python": 0.9,
"JavaScript": 1.1
},
"refactoring_probability": 0.3,
"debugging_probability": 0.2
}
Usage and Examples
All commands use the wakatimer entry point.
Basic Syntax
wakatimer [source_directory] [destination_directory] [options]
Simulation Modes
-
Auto Mode (Default): Automatically estimates coding time based on project complexity.
wakatimer ./my-project ./output-dir --mode auto
-
Manual Mode: Specify an exact duration in hours.
# Simulate 8.5 hours of work wakatimer ./my-project ./output-dir --mode manual --hours 8.5
Using Project Templates
Use pre-defined templates for different project types.
# Use the web application template
wakatimer ./my-project ./output-dir --template web_app
# Use the data science template
wakatimer ./my-project ./output-dir --template data_science
You can also create custom templates in the templates/ directory and load them.
Ignoring Files
Exclude specific files or directories using glob patterns. The --ignore flag can be used multiple times.
# Ignore log files and the node_modules directory
wakatimer ./my-project ./output-dir --ignore "*.log" --ignore "node_modules/*"
Resuming a Session
Long simulations can be paused (Ctrl+C) and resumed later. Wakatimer automatically saves progress.
# Start a long simulation
wakatimer ./big-project ./output-dir --mode manual --hours 20
# If interrupted, resume it later using the --resume flag
wakatimer ./big-project ./output-dir --resume
How It Works
Time Tracking Logic
The script simulates the behavior of time tracking apps:
- Continuous activity detection through file modifications
- Grace periods between changes (up to ~1.5 minutes)
- Realistic coding session patterns
File Processing
- Analysis Phase: Scans project structure and categorizes files
- Setup Phase: Simulates initial project setup (30s-2min)
- Coding Phase: Processes code files with human-like behavior
- Asset Phase: Quickly copies binary files and assets
- Summary: Reports total time and accuracy
Realistic Delays Include
- Planning and reading time before coding
- Variable typing speeds based on file complexity
- Debugging phases (20% chance per file)
- Micro-pauses during typing
- Break times between files
- Code review periods
Advanced Simulation Features
Wakatimer includes several features to make the generated data look more human and realistic.
- Testing Cycles: Simulates a realistic test-driven development workflow: write code โ write test โ test fails โ fix code โ test passes.
- Research Pauses: Adds thinking time for complex problems, with longer pauses for more complex algorithms.
- Copy-Paste Simulation: Mimics real coding behavior where some content appears faster, simulating copy-pasting from external sources. This applies primarily to larger files to maintain realism.
Supported File Types
Code Files (Full Simulation)
- Languages: Python, JavaScript, TypeScript, Java, C++, C#, PHP, Ruby, Go, Rust, Swift, Kotlin, and 30+ more
- Config: JSON, YAML, XML, TOML, INI files
- Documentation: Markdown, reStructuredText, plain text
- Web: HTML, CSS, SCSS, Vue, Svelte
- Scripts: Shell, PowerShell, Batch files
Binary Files (Quick Copy)
- Images: JPG, PNG, GIF, SVG, etc.
- Videos: MP4, AVI, MOV, etc.
- Audio: MP3, WAV, OGG, etc.
- Archives: ZIP, RAR, TAR, etc.
- Executables: EXE, DLL, SO, etc.
- Documents: PDF, DOC, XLS, etc.
Automatically Skipped
- node_modules, .git, .svn directories
- Build outputs: dist, build, target, bin, obj
- Cache directories: pycache, .pytest_cache
- IDE files: .idea, .vscode, .vs
Session Management and Analytics
All session data, including progress files and final reports, is stored in the WakatimerSessions/ directory.
Folder Structure
- Resume Files: Temporary
.pklfiles store session state, allowing you to resume if the simulation is interrupted. - Completed Sessions: Each completed simulation gets its own timestamped folder.
WakatimerSessions/
โโโ project_name_session.pkl # Temporary session files (for resume)
โโโ WakatimerSession_project_20241225_143022/ # Completed sessions
โ โโโ project_session.pkl # Final session data
โ โโโ session_report.json # Detailed analytics
โ โโโ timeline.txt # Visual timeline (ASCII art)
โ โโโ analytics/ # CSV exports
โ โโโ session_summary.csv
โ โโโ language_breakdown.csv
โโโ WakatimerSession_webapp_20241225_150145/ # Another project session
โโโ ...
Analytics Export Formats
- CSV Files (
analytics/):session_summary.csv: Overall session metrics.language_breakdown.csv: Time spent per programming language.
- JSON Report (
session_report.json): Complete session metadata, detailed productivity metrics, and timeline data. - Timeline Chart (
timeline.txt): A visual ASCII timeline providing an hourly breakdown with language distribution and session flow visualization.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for development setup, testing guidelines, and pull request instructions.
Changelog
For a detailed history of changes, please refer to CHANGELOG.md.
License
This tool is provided as-is for educational and personal use under the MIT License. Use responsibly and in accordance with your time tracking service's terms of service. See the License for more details.
Made with โค๏ธ by Sukarth Achaya
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wakatimer-2.0.2.tar.gz.
File metadata
- Download URL: wakatimer-2.0.2.tar.gz
- Upload date:
- Size: 62.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73cb8fd3a530bee8394f1a3902479987df9b8f16ab0973a1b3760743a5f6ff3e
|
|
| MD5 |
ca31a43fc4c8cfff1fd58765aaccc879
|
|
| BLAKE2b-256 |
b32176679f047db60029a7617b75d3246f13798f213fe2c1400914efc5bdb2bd
|
File details
Details for the file wakatimer-2.0.2-py3-none-any.whl.
File metadata
- Download URL: wakatimer-2.0.2-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee3e25db0d59c2cace149f91f3248a96587c99c7221b1dd79218d3be9f020207
|
|
| MD5 |
bb00ec6ebc7691953ac52763ad74417a
|
|
| BLAKE2b-256 |
b2f5d5a937bd771e30c019ee0316b5d4a77f45562345cc7aa2deb475bbff0b46
|