{"id":29908865,"url":"https://github.com/mcgarrah/git_timesheet_python","last_synced_at":"2026-03-27T07:11:53.073Z","repository":{"id":299500936,"uuid":"1003242323","full_name":"mcgarrah/git_timesheet_python","owner":"mcgarrah","description":"Generate Git Timesheets from Commit Logs (Library and CLI)","archived":false,"fork":false,"pushed_at":"2025-08-18T09:18:54.000Z","size":69,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T01:52:42.611Z","etag":null,"topics":["git","time-management-tools","timesheet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcgarrah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-16T21:04:28.000Z","updated_at":"2025-06-18T19:30:15.000Z","dependencies_parsed_at":"2025-06-16T22:23:38.471Z","dependency_job_id":"5aedea44-214a-45c6-82c7-2da85b4f977e","html_url":"https://github.com/mcgarrah/git_timesheet_python","commit_stats":null,"previous_names":["mcgarrah/git_timesheet_python"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mcgarrah/git_timesheet_python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcgarrah%2Fgit_timesheet_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcgarrah%2Fgit_timesheet_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcgarrah%2Fgit_timesheet_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcgarrah%2Fgit_timesheet_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcgarrah","download_url":"https://codeload.github.com/mcgarrah/git_timesheet_python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcgarrah%2Fgit_timesheet_python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31032130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T06:08:13.374Z","status":"ssl_error","status_checked_at":"2026-03-27T06:08:07.217Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","time-management-tools","timesheet"],"created_at":"2025-08-02T00:44:57.826Z","updated_at":"2026-03-27T07:11:53.046Z","avatar_url":"https://github.com/mcgarrah.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Timesheet Generator\n\nA Python package to generate git timesheets from commit history, specifically filtering for commits by a particular author.\n\n## Overview\n\nThis tool analyzes git commit history across multiple repositories and:\n\n- Filters commits by author name/email\n- Estimates time spent on each commit (in 15-minute increments)\n- Adjusts time based on commit message keywords\n- Groups work by day and week\n- Formats output as a readable timesheet\n\n## Requirements\n\n- Python 3.8+\n- pytz library\n- click library\n\n## Installation\n\n### From PyPI\n\n```bash\n# Create and activate a virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install the package\npip install git-timesheet\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/mcgarrah/git-timesheet.git\ncd git-timesheet\n\n# Create and activate a virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install in development mode\npip install -e .\n```\n\n## Configuration\n\nThe tool supports configuration files to set default values. It looks for configuration files in the following locations (in order of precedence):\n\n1. `.ggtsrc` in the current directory\n2. `ggts.ini` in the current directory\n3. `.ggtsrc` in the user's home directory\n4. `ggts.ini` in the user's `.config` directory\n5. `config.ini` in the user's `.config/git-timesheet` directory\n\nYou can create a configuration file using the `ggts init` command, or manually create one with the following format:\n\n```ini\n[defaults]\n# Author pattern to filter commits\nauthor = michael mcgarrah\n\n# Default timezone for dates\ntimezone = US/Eastern\n\n# Minutes between commits to consider them part of the same work session\nsession_timeout = 60\n```\n\nCommand-line arguments always override values from configuration files.\n\n## Usage\n\n```bash\n# Generate a timesheet (default command)\nggts [OPTIONS]\n# or explicitly\nggts generate [OPTIONS]\n\n# Initialize configuration\nggts --init\n# or\nggts init\n```\n\n### Options\n\n- `--base-dir PATH`: Base directory containing git repositories (default: current directory)\n- `--since DATE`: Show commits more recent than a specific date (e.g., \"2 weeks ago\")\n- `--until DATE`: Show commits older than a specific date\n- `--repos REPO`: Specific repository names to include (can be used multiple times)\n- `--output FORMAT`: Output format (text, csv, markdown, or md, default: text)\n- `--author PATTERN`: Filter commits by author (default from config or \"mcgarrah\")\n- `--timezone TIMEZONE`: Timezone for dates (default from config or \"UTC\")\n- `--output-file PATH`: Write output to file instead of stdout\n- `--session-timeout MINUTES`: Minutes between commits to consider them part of the same work session (default from config or 60)\n\n## Examples\n\n### Generate timesheet for the last 2 weeks\n\n```bash\n# Using default command\nggts --since=\"2 weeks ago\"\n# or explicitly\nggts generate --since=\"2 weeks ago\"\n```\n\n### Generate timesheet for specific repositories\n\n```bash\nggts generate --repos food_service_nutrition --repos food-intelligence-app --since=\"1 month ago\"\n```\n\n### Generate timesheet for a specific date range\n\n```bash\nggts generate --since=\"2023-01-01\" --until=\"2023-01-31\"\n```\n\n### Generate timesheet with specific author pattern\n\n```bash\nggts generate --author=\"michael mcgarrah\" --since=\"2 weeks ago\"\n```\n\n### Generate timesheet in US Eastern timezone\n\n```bash\nggts generate --since=\"1 month ago\" --timezone=\"US/Eastern\"\n```\n\n### Generate CSV output for spreadsheet import\n\n```bash\nggts generate --since=\"1 month ago\" --output=csv --output-file=timesheet.csv\n```\n\n### Generate markdown output for pretty formatting\n\n```bash\nggts generate --since=\"1 month ago\" --output=markdown --output-file=timesheet.md\n```\n\n### Initialize configuration\n\n```bash\n# Using the dedicated command\nggts init\n# or using the flag\nggts --init\n```\n\n## Output Formats\n\n### Text Format\n\nPlain text output organized by weeks and days, showing detailed commit information with timezone abbreviations.\n\n### CSV Format\n\nComma-separated values format suitable for importing into spreadsheet applications like Excel or Google Sheets. Includes timezone information for each entry.\n\n### Markdown Format\n\nPretty markdown format with tables organized by week, suitable for viewing in markdown readers or converting to HTML. Includes time ranges and timezone abbreviations for each task to better understand work sessions.\n\n## Time Estimation Logic\n\n- Base time: 15 minutes per commit\n- Bug fixes/issues: +15 minutes\n- New features/implementations: +30 minutes\n- Refactoring/improvements: +15 minutes\n- Commits close together (within 60 minutes by default) are considered part of the same work session\n\n## Timezone Support\n\nThe tool supports various timezone formats:\n\n- IANA timezone names (e.g., \"America/New_York\")\n- Common US timezone aliases (e.g., \"US/Eastern\")\n- Short timezone abbreviations (e.g., \"EST\", \"EDT\")\n- Prefixed short timezone abbreviations (e.g., \"US/EST\")\n\n## Development\n\n### Setup Development Environment\n\n```bash\n# Clone the repository\ngit clone https://github.com/mcgarrah/git-timesheet.git\ncd git-timesheet\n\n# Create and activate a virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install development dependencies\npip install -e \".[dev]\"\n```\n\n### Testing\n\nThe project includes a comprehensive test suite using pytest. To run the tests:\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage report\npytest --cov=git_timesheet\n\n# Run a specific test file\npytest tests/test_timezone.py\n```\n\n### Test Structure\n\n- **Unit Tests**: Test individual functions in isolation\n  - `test_timezone.py`: Tests for timezone conversion and abbreviation\n  - `test_git_operations.py`: Tests for git repository detection and log retrieval\n  - `test_formatting.py`: Tests for output formatting functions\n\n- **Integration Tests**: Test the entire workflow\n  - `test_integration.py`: End-to-end tests using temporary git repositories\n\n### Building Documentation\n\n```bash\npip install -e \".[docs]\"\ncd docs\nmake html\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcgarrah%2Fgit_timesheet_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcgarrah%2Fgit_timesheet_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcgarrah%2Fgit_timesheet_python/lists"}