Skip to content

A comprehensive tool that scans top GitHub repositories based on keywords, analyzes their contribution status, and generates detailed technical reports for each repository.

Notifications You must be signed in to change notification settings

ashutoshsom1/Github-Agent

Repository files navigation

GitHub Repository Analysis Agent

A comprehensive tool that scans top GitHub repositories based on keywords, analyzes their contribution status, and generates detailed technical reports for each repository.

🌟 Features

  • πŸ” Repository Discovery: Search top repositories by keywords using GitHub API
  • πŸ“Š Contribution Analysis: Automatically classify repositories by contribution acceptance
  • πŸ“‹ Technical Reporting: Generate detailed reports for technical professionals
  • πŸ“§ Email Delivery: Automated report distribution via email
  • ⚑ Rate Limiting: Smart API usage with caching and rate limiting
  • 🎯 Contribution Scoring: Advanced algorithm to score contribution opportunities
  • πŸ“± Rich CLI Interface: Beautiful command-line interface with progress tracking

οΏ½ Screenshots

CLI Interface in Action

CLI Interface Beautiful command-line interface with real-time progress tracking

Analysis Results

Analysis Summary Smart categorization of repositories by contribution readiness

Email Reports

Email Report Email Report Detail 1 Email Report Detail 2 Comprehensive HTML reports delivered directly to your inbox

Demo Video

Watch the demo video Watch the demo video to see the agent in action!

πŸ“– Table of Contents

οΏ½πŸš€ Quick Start

1. Installation

# Clone the repository
git clone <your-repo-url>
cd "Github Agent"

# Install dependencies
pip install -r requirements.txt

2. Configuration

  1. Get a GitHub Personal Access Token:

    • Go to GitHub Settings β†’ Developer settings β†’ Personal access tokens
    • Generate a new token with public_repo scope
    • Copy the token
  2. Set up Email Credentials:

    • For Gmail, enable 2FA and create an App Password
    • For other providers, get SMTP credentials
  3. Create Environment File:

    cp .env.example .env

    Edit .env with your credentials:

    GITHUB_TOKEN=ghp_your_github_token_here
    EMAIL_HOST=smtp.gmail.com
    EMAIL_PORT=587
    [email protected]
    EMAIL_PASSWORD=your_app_password_here
    

3. Usage

Command Line Interface

# Analyze machine learning repositories
python main.py --keyword "machine learning" --email "[email protected]"

# Customize search parameters
python main.py -k "web development" -e "[email protected]" --max-repos 30 --min-stars 500

Python API

import asyncio
from src.github_agent import GitHubAnalysisAgent

async def main():
    agent = GitHubAnalysisAgent()
    analyses = await agent.analyze_repositories(
        keyword="python", 
        recipient_email="[email protected]"
    )
    
    # Print results
    for analysis in analyses[:5]:
        print(f"{analysis.full_name} - Score: {analysis.contribution_score}/100")

asyncio.run(main())

πŸ“Š What You Get

Email Report Contains:

  • Summary Dashboard: Overview of all analyzed repositories
  • Contribution Status Distribution: Visual breakdown of repository categories
  • Top Opportunities: Highest-scoring repositories for contributions
  • Individual Reports: Detailed analysis for each repository

Individual Repository Reports Include:

  • βœ… Contribution Readiness Score (0-100)
  • 🎯 Specific Recommendations based on repository status
  • πŸš€ Getting Started Guide with step-by-step instructions
  • πŸ”§ Technical Requirements and setup complexity
  • πŸ“ˆ Maintainer Activity and response time estimates
  • 🏷️ Issue Labels for beginners (good-first-issue, help-wanted)
  • πŸ“ Contributing Guidelines analysis

πŸ—οΈ Project Structure

Github Agent/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ github_agent/
β”‚   β”‚   β”œβ”€β”€ __init__.py          # Main agent class
β”‚   β”‚   β”œβ”€β”€ api_client.py        # GitHub API wrapper
β”‚   β”‚   β”œβ”€β”€ analyzer.py          # Repository analysis logic
β”‚   β”‚   β”œβ”€β”€ report_generator.py  # HTML report generation
β”‚   β”‚   └── email_sender.py      # Email functionality
β”‚   └── config/
β”‚       └── settings.py          # Configuration management
β”œβ”€β”€ main.py                      # CLI interface
β”œβ”€β”€ example.py                   # Usage examples
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ .env.example                 # Environment template
└── README.md                    # This file

🎯 Repository Classification

The agent classifies repositories into four categories:

  1. 🟒 Actively Accepting (Score: 70-100)

    • Has contributing guidelines
    • Good first issues available
    • Recent commit activity
    • Active maintainer responses
  2. 🟑 Limited Scope (Score: 40-69)

    • Some contribution opportunities
    • Moderate activity
    • May have specific requirements
  3. πŸ”΄ Not Accepting (Score: 0-39)

    • No clear contribution process
    • Low activity
    • Minimal documentation
  4. βšͺ Archived/Inactive (Score: N/A)

    • Archived repositories
    • No recent activity

βš™οΈ Configuration Options

Environment variables you can set in .env:

# Required
GITHUB_TOKEN=your_token
EMAIL_HOST=smtp.gmail.com
[email protected]
EMAIL_PASSWORD=your_password

# Optional
EMAIL_PORT=587                   # SMTP port (default: 587)
MAX_REPOSITORIES=50              # Max repos to analyze (default: 50)
MIN_STARS=100                    # Minimum stars filter (default: 100)

πŸ”§ Advanced Usage

Custom Analysis

from src.github_agent.analyzer import RepositoryAnalyzer
from src.github_agent.api_client import GitHubAPIClient

# Analyze specific repositories
analyzer = RepositoryAnalyzer()
api_client = GitHubAPIClient()

# Custom search parameters
repositories = await api_client.search_repositories(
    keyword="rust programming", 
    sort="updated"
)

Batch Processing

keywords = ["machine learning", "web development", "data science"]
email = "[email protected]"

for keyword in keywords:
    await agent.analyze_repositories(keyword, email)

🎨 Sample Output

πŸ” GitHub Repository Analysis Agent
Keyword: machine learning
Email: [email protected]
Max Repositories: 20
Min Stars: 100

πŸ“Š Found 20 repositories to analyze
βœ… Analysis complete! Reports sent to [email protected]

βœ… Analysis Complete!
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Status          β”‚ Count β”‚ Percentage β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Actively Accept β”‚   12  β”‚    60.0%   β”‚
β”‚ Limited Scope   β”‚    5  β”‚    25.0%   β”‚
β”‚ Not Accepting   β”‚    2  β”‚    10.0%   β”‚
β”‚ Archived Inact  β”‚    1  β”‚     5.0%   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⭐ Top Repositories by Contribution Score:
  1. βœ… scikit-learn/scikit-learn - Score: 95/100
     ⭐ 52,847 stars β€’ 🍴 23,495 forks β€’ 🎯 45 good first issues
  2. βœ… tensorflow/tensorflow - Score: 88/100
     ⭐ 176,543 stars β€’ 🍴 88,432 forks β€’ 🎯 23 good first issues

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Troubleshooting

Common Issues:

  1. GitHub API Rate Limiting:

    • The tool automatically handles rate limits
    • Use a personal access token for higher limits
  2. Email Authentication Errors:

    • For Gmail, use an App Password, not your regular password
    • Enable 2FA first, then generate an App Password
  3. Missing Dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt
  4. Environment Variables Not Loading:

    • Ensure .env file is in the project root
    • Check for typos in variable names

Support

For issues and questions:

  • Create an issue on GitHub
  • Check existing issues for solutions
  • Review the example.py file for usage patterns

About

A comprehensive tool that scans top GitHub repositories based on keywords, analyzes their contribution status, and generates detailed technical reports for each repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages