A comprehensive Python tool to analyze and generate detailed reports from closed GitHub issues. Perfect for tracking team performance, analyzing issue resolution patterns, and generating insights for project management.
- π Advanced Filtering: Filter by labels, date ranges, assignees, and more
- π Multiple Export Formats: Console display, CSV, and JSON exports
- π Comprehensive Analytics:
- Issues by labels, assignees, and authors
- Time-based trends (monthly, weekly)
- Average resolution times
- Label combination analysis
- β‘ Efficient Processing: Smart pagination and API optimization
- π Flexible Date Ranges: Last N days, custom periods, or specific dates
- Python 3.7+
- GitHub Personal Access Token
- Required packages:
requests,python-dotenv
git clone https://github.com/CloudSecOpsAI/github-utilities.git
cd github-utilities/issue-analyzer
pip install -r requirements.txt- Get a GitHub Personal Access Token with
reposcope - Copy the environment template:
cp env.example .env- Edit
.envand add your token:
GITHUB_TOKEN=your_token_here# Console report for last 30 days
python github-issues-analyzer.py --owner myorg --repo myrepo
# Export to CSV with specific labels
python github-issues-analyzer.py --owner myorg --repo myrepo --labels "bug,enhancement" --format csv
# Custom date range with JSON export
python github-issues-analyzer.py --owner myorg --repo myrepo --since 2024-01-01 --until 2024-03-31 --format json| Option | Required | Description | Example |
|---|---|---|---|
--owner |
β | Repository owner/organization | --owner microsoft |
--repo |
β | Repository name | --repo vscode |
--labels |
β | Comma-separated labels | --labels "bug,enhancement" |
--days |
β | Days to look back (default: 30) | --days 90 |
--since |
β | Start date (YYYY-MM-DD) | --since 2024-01-01 |
--until |
β | End date (YYYY-MM-DD) | --until 2024-03-31 |
--format |
β | Output: console/csv/json | --format csv |
--token |
β | GitHub token (or use .env) | --token ghp_xxx |
π GITHUB ISSUES ANALYSIS REPORT
π Repository: microsoft/vscode
π
Generated: 2024-08-07 19:18:38
π SUMMARY STATISTICS
Total Closed Issues: 156
Average Days to Close: 12.3 days
π·οΈ ISSUES BY LABEL
bug: 89 (57.1%)
enhancement: 34 (21.8%)
documentation: 18 (11.5%)
good-first-issue: 15 (9.6%)
π₯ ISSUES BY ASSIGNEE
contributor1: 45 (28.8%)
contributor2: 32 (20.5%)
contributor3: 28 (17.9%)
π TOP LABEL COMBINATIONS
[bug]: 56 (35.9%)
[enhancement]: 23 (14.7%)
[bug, high-priority]: 12 (7.7%)
Generated files include detailed issue data:
- Issue number, title, author
- Assignees and labels
- Creation and closure dates
- Time to resolution
- Direct GitHub URLs
Structured data perfect for:
- Dashboard integration
- Automated reporting
- API consumption
- Data analysis pipelines
# Monthly team report
python github-issues-analyzer.py --owner myorg --repo myrepo --days 30 --format csv# Analyze bug resolution patterns
python github-issues-analyzer.py --owner myorg --repo myrepo --labels "bug" --days 90# Specific sprint period
python github-issues-analyzer.py --owner myorg --repo myrepo --since 2024-07-01 --until 2024-07-14# High-priority issues
python github-issues-analyzer.py --owner myorg --repo myrepo --labels "priority-high,critical"# Quarterly analysis with JSON export
python github-issues-analyzer.py --owner myorg --repo myrepo --days 90 --format jsonCheck the examples/ directory for ready-to-run scripts:
# Basic report example
./examples/basic-report.sh
# CSV export example
./examples/csv-export.sh
# Advanced analysis example
./examples/advanced-analysis.sh# Set token via environment
export GITHUB_TOKEN=your_token_here
# Or use .env file (recommended)
echo "GITHUB_TOKEN=your_token_here" > .env# Multiple labels (issues with ANY of these labels)
--labels "bug,enhancement,documentation"
# Labels with special characters (use quotes)
--labels "good-first-issue,help-wanted"
# Complex label names
--labels "customer:enterprise,priority:high"# Last week
--days 7
# Last quarter
--days 90
# Specific month
--since 2024-07-01 --until 2024-07-31
# Year-to-date
--since 2024-01-01Authentication Error
β Missing GitHub token
Solution: Set GITHUB_TOKEN in .env file or environment
No Issues Found
βΉοΈ No issues found matching the criteria
Solutions:
- Check repository name and owner
- Verify label names (case-sensitive)
- Try longer time period
- Remove label filters to see all issues
Rate Limit
β Failed to fetch issues: 403
Solution: Wait for rate limit reset or use narrower date range
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this tool helpful, please consider:
- β Starring the repository
- π Reporting issues
- π‘ Suggesting features
- π€ Contributing code
Made with β€οΈ for the GitHub community