Extract Git commits from repositories and export to Excel, with built-in GitHub Actions support.
The easiest way to use this tool is via the reusable workflow - no files to copy, no maintenance needed!
Create .github/workflows/extract-commits.yml in your repository:
name: Extract Commits
on:
schedule:
- cron: '0 1 * * *' # Daily at 1 AM UTC
workflow_dispatch:
jobs:
extract:
uses: hfduran/canaicode-git-extractor/.github/workflows/extract-and-upload-reusable.yml@main
secrets:
upload_url: ${{ secrets.UPLOAD_ENDPOINT_URL }}
upload_key: ${{ secrets.UPLOAD_AUTH_KEY }}That's it! No Python files to copy. See SETUP.md for detailed setup instructions.
- Automatic daily extraction (or manual trigger)
- Analyzes the current repository by default
- Excel file uploaded to your endpoint
- Backup artifact stored in GitHub Actions (30 days)
- Version pinning (
@main,@v1, etc.) - Centralized updates (no maintenance in your repos)
If you want to run the extractor locally or outside GitHub Actions:
- Python 3.10+
- Git
pip install -r requirements.txt
# or
pip install gitpython pandas pydantic xlsxwriterSingle repository:
python scripts/canaicode_git_extractor.py /path/to/repo -s 2024-01-01 -e 2024-12-31
python scripts/canaicode_git_extractor.py https://github.com/user/repo.git -s 2024-01-01 -e 2024-12-31Multiple repositories from file:
python scripts/canaicode_git_extractor.py -f repos.txt -s 2024-01-01 -e 2024-12-31Verbose output:
python scripts/canaicode_git_extractor.py /path/to/repo -s 2024-01-01 -e 2024-12-31 -vUpload to endpoint:
python scripts/upload_to_endpoint.py commits_2024-01-01_to_2024-12-31.xlsx \
--url https://api.example.com/upload \
--key YOUR_API_KEYCreates commits_YYYY-MM-DD_to_YYYY-MM-DD.xlsx with one sheet per repository.
Columns: hash, repository, date, author, language, added_lines, removed_lines
Each row represents a file modified in a commit.