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 <your-repo-url>
cd github-issues-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📊 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
