A Python script to fetch commit data from a GitHub organization, filter by committer email, and generate a timelog CSV using AI estimation.
- Clone or download the repository.
- Install dependencies:
pip install -r requirements.txt - Copy
.env.exampleto.envand fill in your tokens:GITHUB_TOKEN: GitHub Personal Access Token withreposcope.XAI_API_KEY: Your xAI API key.
Run the script with:
python main.py --org <organization> --email <committer_email> [--since YYYY-MM-DD] [--master <path/to/master.csv>]--org: GitHub organization name (required)--email: Email of the committer to filter commits (required)--since: Optional date to fetch commits from (default: last year)--master: Optional path to master worklog CSV to mix with generated data
Example:
python main.py --org mycompany --email developer@mycompany.com --since 2023-01-01Example with master worklog mixing:
python main.py --org mycompany --email developer@mycompany.com --master master_worklog.csv --since 2023-01-01The script supports mixing AI-generated tasks from commits with authoritative master worklog records using LLM-based intelligent distribution.
When the --master option is provided, the script:
- Reads the master worklog CSV (expected columns: Date, Task Name, Job Done, Time Spent)
- Groups data by date
- For each date, uses an LLM to distribute the total master time proportionally among the generated tasks based on relevance
- Extends each task's description with relevant details from master records
- Ensures the sum of time spent matches the master total
This produces enriched, meaningful tasks suitable for reporting.
The output will be saved to timelog.csv in the current directory.
The CSV contains columns: Date, Task Name, Job Done, Time Spent (hours).
- Ensure your GitHub token has access to the organization's repositories.
- The script handles pagination and rate limiting automatically.
- Commit messages are processed by xAI Grok API to estimate time spent.