A lightweight Python scraper that pulls a repo's README, asks Grok (xAI) to distill it into tight bullet points, and then uses that summary to discover and recommend similar GitHub repositories to explore.
- Scrape any public GitHub repo's README
- Summarize using Grok (
grok-code-fast-1) via xAI API - Returns only concise bullet points:
- Project purpose
- Tech stack
- Key features
- Target audience
- Recommends Similar Repos
- Secrets stored securely in
.env - Minimal dependencies
flowchart TD
%% ==== Entry Point ====
A[Enter GitHub Repo] --> B[Scrape from GitHub]
%% ==== Main Path ====
B --> C[Save to DB]
C --> D[AI Analysis]
D --> E[Find Similar Repos]
E --> F[Show Report]
%% ==== Branch: Detail Scraping ====
E --> G[Send to AI]
G --> H[Scrape Their Details]
H --> E
%% ==== Styling ====
classDef startEnd fill:#2d2d2d,stroke:#ffcc00,stroke-width:2px,color:#fff
classDef process fill:#1a1a1a,stroke:#ffcc00,stroke-width:1px,color:#fff
classDef ai fill:#2d2d2d,stroke:#00ccff,stroke-width:2px,color:#00ccff
classDef report fill:#2d2d2d,stroke:#ffcc00,stroke-width:2px,color:#ffcc00
class A,F startEnd
class B,C,E,H process
class D,G ai
class F report
- Python 3.8+
requests,beautifulsoup4,python-dotenv,openai(for xAI compatibility)
# Clone or copy this project
git clone <your-repo-url>
cd github-repo-summarizer
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt-
Get your Grok API key
→ console.x.ai → Create API key -
Create
.envfile in the project root:
GROK_API_KEY=your_xai_api_key_hereNever commit
.envto Git! Add to.gitignore.
from summarizer import summarize_github_repo
# Example: Summarize FastAPI
summary = summarize_github_repo("tiangolo/fastapi")
print(summary)Sample Output:
- High-performance web framework for building APIs with Python 3.7+
- Built on Starlette and Pydantic for speed and validation
- Auto-generates OpenAPI and interactive docs (Swagger UI, ReDoc)
- Ideal for production APIs, microservices, and async backends
.
├── llm.py # Grok API client & prompt
├── scraper.py # GitHub README fetcher
├── summarizer.py # Main function
├── .env # Your secrets (gitignored)
├── requirements.txt
└── README.md
requests
beautifulsoup4
python-dotenv
openai>=1.0.0- Uses
https://api.x.ai/v1— fully compatible with OpenAI SDK - Grok-4 gives best reasoning; use
grok-3-minifor speed/cost - Rate-limited by your xAI credits (monitor at console.x.ai)
GPLv3
Built with Grok API | Simple. Fast. Bulletproof.
