A powerful, modular Python application that analyzes your GitHub and GitLab repositories to generate comprehensive portfolio summaries using multiple AI providers. Built with clean architecture principles for maintainability and extensibility.
๐ NEW in v2.0.0: Complete architectural refactor with modular design, improved error handling, and professional CLI interface!
# Install dependencies
pip install -r requirements.txt
# Set up API key (get one from https://aistudio.google.com/)
export GEMINI_API_KEY="your_gemini_api_key"
# Check configuration
python portfolio_generator_cli.py --check-config
# Generate portfolio with default settings (Google Gemini)
python portfolio_generator_cli.py
# Generate with specific AI provider
python portfolio_generator_cli.py --model-provider anthropic --model-name claude-3-5-haiku-latest
- Features
- Installation
- Configuration
- Usage
- Architecture
- AI Models & Providers
- API Setup
- Output
- Troubleshooting
- Contributing
- License
- Multi-platform support: GitHub and GitLab (including self-hosted)
- Comprehensive analysis: Public and private repositories
- Smart filtering: Configurable commit thresholds and project selection
- Rate limiting: Automatic handling with intelligent delays
- Stage-based execution: Separate data collection and analysis phases
- Multiple AI providers: Anthropic Claude, OpenAI GPT, Google Gemini
- Professional summaries: Detailed portfolio analysis and recommendations
- Top project highlights: AI-identified most significant projects
- Code metrics: Estimated lines of code across all projects
- Interview preparation: Generated talking points and project highlights
- Modular design: Clean separation of concerns
- Extensible: Easy to add new AI providers or repository platforms
- Testable: Comprehensive error handling and logging
- Professional CLI: Rich help system and configuration validation
- Python 3.8 or higher
- pip package manager
# Clone the repository
git clone https://github.com/yourusername/portfolio-generator.git
cd portfolio-generator
# Install core dependencies
pip install -r requirements.txt
# Optional: Install specific AI providers
pip install anthropic # For Anthropic Claude
pip install openai # For OpenAI GPT
pip install google-generativeai # For Google Gemini# Install in development mode
pip install -e .
# Install development dependencies
pip install -e ".[dev]"Set up your API keys and tokens:
# AI Provider API Keys (at least one required)
export GEMINI_API_KEY="your_gemini_api_key" # Google Gemini (recommended - free)
export ANTHROPIC_API_KEY="your_anthropic_api_key" # Anthropic Claude (paid)
export OPENAI_API_KEY="your_openai_api_key" # OpenAI GPT (paid/free tiers)
# Repository tokens (optional - for private repos and higher rate limits)
export GITHUB_TOKEN="your_github_token"
export GITLAB_TOKEN="your_gitlab_token"
# Optional GitLab configuration
export GITLAB_URL="https://your-gitlab-instance.com" # For self-hosted GitLab# Verify your configuration
python portfolio_generator_cli.py --check-config# Generate portfolio with default settings
python portfolio_generator_cli.py
# Use specific usernames (for public repos)
python portfolio_generator_cli.py --github-username myuser --gitlab-username myuser
# Use existing data to regenerate summary
python portfolio_generator_cli.py --use-existing# Use specific AI provider and model
python portfolio_generator_cli.py --model-provider anthropic --model-name claude-3-5-sonnet-latest
# Analyze only GitHub repositories with limits
python portfolio_generator_cli.py --platform github --max-commits 50 --min-commits 5
# Run only data collection (Stage 1)
python portfolio_generator_cli.py --stage 1
# Run only analysis (Stage 2)
python portfolio_generator_cli.py --stage 2
# Enable debug mode
python portfolio_generator_cli.py --debug| Option | Description | Default |
|---|---|---|
--github-username |
GitHub username (optional if using token) | None |
--gitlab-username |
GitLab username (optional if using token) | None |
--platform |
Analyze only specific platform (github or gitlab) |
Both |
--use-existing |
Use most recent data file instead of fetching new | False |
--stage |
Run specific stage: 1=data collection, 2=analysis |
Both |
--min-commits |
Minimum user commits required for inclusion | 1 |
--max-commits |
Maximum commits per project in JSON | All |
--model-provider |
AI provider: anthropic, openai, google |
google |
--model-name |
Specific model name | Provider default |
--debug |
Enable debug logging | False |
--check-config |
Check configuration and exit | False |
The application follows a clean, modular architecture:
src/
โโโ ai_providers/ # AI provider implementations
โ โโโ anthropic_provider.py
โ โโโ openai_provider.py
โ โโโ gemini_provider.py
โ โโโ factory.py
โโโ repository_managers/ # Repository platform handlers
โ โโโ github_manager.py
โ โโโ gitlab_manager.py
โโโ config/ # Configuration management
โ โโโ config_manager.py
โ โโโ portfolio_config.py
โโโ utils/ # Utility functions
โ โโโ file_analyzer.py
โ โโโ data_processor.py
โ โโโ logger.py
โโโ portfolio_generator.py # Main application
- Single Responsibility: Each module has one clear purpose
- Open/Closed: Easy to extend without modifying existing code
- Dependency Inversion: High-level modules depend on abstractions
- Error Handling: Comprehensive exception handling and logging
For detailed architecture documentation, see ARCHITECTURE.md.
| Provider | Model | Cost | Reasoning | Best For |
|---|---|---|---|---|
gemini-2.5-pro |
โ Free | โ No | Default choice - Excellent free analysis | |
gemini-2.5-flash |
โ Free | โ No | Fastest option | |
| Anthropic | claude-3-5-sonnet-latest |
๐ฐ Paid | โ No | High-quality analysis |
| Anthropic | claude-3-5-haiku-latest |
๐ฐ Paid | โ No | Cheaper Claude option |
| OpenAI | gpt-4.1-nano |
๐ Free tier | โ No | Good free option |
| OpenAI | o4-mini |
๐ฐ Paid | โ Yes | Reasoning capabilities |
For beginners or cost-conscious users:
python portfolio_generator_cli.py # Uses free Gemini 2.5 ProFor premium quality:
python portfolio_generator_cli.py --model-provider anthropic --model-name claude-3-5-sonnet-latestFor fastest results:
python portfolio_generator_cli.py --model-provider google --model-name gemini-2.5-flash- Visit Google AI Studio
- Create a new API key
- Set as
GEMINI_API_KEYenvironment variable
- Sign up at Anthropic Console
- Generate an API key
- Set as
ANTHROPIC_API_KEYenvironment variable
- Sign up at OpenAI Platform
- Generate an API key
- Set as
OPENAI_API_KEYenvironment variable
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate token with
reposcope (orpublic_repofor public only) - Set as
GITHUB_TOKENenvironment variable
- Go to GitLab User Settings > Access Tokens
- Create token with
read_repositoryscope - Set as
GITLAB_TOKENenvironment variable
-
portfolio_data_[timestamp].json- Raw repository data- Complete repository metadata
- Commit history and statistics
- Technology usage analysis
- Perfect for further analysis
-
portfolio_summary_[timestamp].md- AI-generated portfolio- Executive summary with code metrics
- Top 5 featured projects
- Technical skills analysis
- Development practices assessment
- Professional growth timeline
- Interview preparation recommendations
# Portfolio Summary
## Executive Summary
- Developer profile with estimated lines of code
- Years of experience based on project timeline
- Primary technical focus areas
## Top 5 Featured Projects
- Detailed project analysis
- Technical stack and complexity
- Contribution levels and impact
## Technical Skills & Expertise
- Programming languages ranked by proficiency
- Frameworks and libraries with context
- Architecture patterns demonstrated
[... and more sections]No projects found:
- Check API tokens have correct permissions
- Verify user info is retrieved correctly
- Ensure commit email matches account email
Zero commits detected:
- Check git config email:
git config --global user.email - Use
--min-commits 0to include all projects - Check debug output for email matching
JSON too large:
- Use
--max-commits 10to limit commits per project - Use
--min-commits 5to filter projects - Use
--platform githubor--platform gitlab
Rate limiting:
- Script handles rate limiting automatically
- Use tokens for higher rate limits
- Consider using
--debugfor detailed output
Enable debug mode for detailed troubleshooting:
python portfolio_generator_cli.py --debugWe welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following our coding standards
- Add tests for new functionality
- Submit a pull request
This project is licensed under the GNU General Public License v3.0 - see the COPYING file for details.
- Thanks to all contributors who help improve this project
- Built with love for the open-source community
- Special thanks to the AI providers for their excellent APIs
Made with โค๏ธ for developers, by developers
For support, questions, or feature requests, please open an issue.