Skip to main content

๐Ÿ“ฆ Repo Scrapper API & AI CLI

PyPI Version Build & Deploy Status Kubernetes Azure ACR FastAPI IaC Terraform License: MIT

An automated, AI-powered GitHub repository search and scraping platform. Features a Grok AI-driven FastAPI backend deployed on Azure Kubernetes Service (AKS) via Terraform & GitHub Actions CI/CD, alongside an interactive PyPI CLI tool (repo-scrapper-cli).


๐Ÿ›๏ธ End-to-End System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        PyPI Package Client                             โ”‚
โ”‚                    pip install repo-scrapper-cli                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚                                      โ”‚
        [ Primary Hybrid Route ]                [ Offline Fallback Route ]
        FastAPI Backend (AKS)                   Direct GitHub REST API
                  โ”‚                                      โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Grok AI Dual-Key Rotator  โ”‚            โ”‚   Rule-Based Engine    โ”‚
    โ”‚ (Key 1 โž” Key 2 Failover)  โ”‚            โ”‚   Regex Extractor      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚                                       โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                                     โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚   GitHub Search REST API โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ป 1. For End Users: CLI Quickstart (PyPI)

If you just want to use the tool to find repositories, you don't need to download the source code โ€” just install it via pip.

Install the CLI tool:

pip install repo-scrapper-cli

Run a search query:

repo-scrapper "top 3 python microservices with docker" --limit 3

Connect to a custom backend URL:

repo-scrapper "react templates" --url "http://your-aks-cluster-ip:8000"

๐Ÿ› ๏ธ 2. For Developers: Local Backend Setup

If you want to run the AI-powered FastAPI backend locally, follow these steps.

Step 1: Clone the repository

git clone https://github.com/Haidar-Karamat/Repo_Scrapper.git
cd Repo_Scrapper

Step 2: Set up a virtual environment

# Windows
python -m venv venv
.\venv\Scripts\Activate.ps1

# Linux / Mac
python3 -m venv venv
source venv/bin/activate

Step 3: Install dependencies

cd server
pip install -r requirements.txt

Step 4: Configure environment variables

Create a .env file inside the server/ directory:

# Grok AI API Keys (Optional, fallback works without it)
GROK_API_KEY_1=your_first_key_here
GROK_API_KEY_2=your_second_key_here

# GitHub Token (Increases rate limit to 5000 req/hr)
GITHUB_TOKEN=ghp_your_github_token_here

Step 5: Run the FastAPI server

uvicorn app.main:app --reload --port 8000

API documentation will be available at: http://localhost:8000/docs


๐Ÿณ 3. For DevOps: Docker Deployment

To run the backend isolated in a container:

# Build the Docker image
docker build -t repo-scrapper-backend ./server

# Run the container (make sure your .env file is ready)
docker run -d -p 8000:8000 --name repo-backend --env-file ./server/.env repo-scrapper-backend

โ˜๏ธ 4. Cloud Deployment (Terraform & Azure AKS)

Step 1: Authenticate with Azure

az login

Step 2: Provision infrastructure with Terraform

cd terraform
terraform init
terraform plan
terraform apply -auto-approve

Step 3: Deploy to Kubernetes

az aks get-credentials --resource-group repo-scrapper-rg --name repo-scrapper-aks
kubectl apply -f k8s/

๐Ÿ“„ License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_scrapper_cli-1.2.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_scrapper_cli-1.2.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file repo_scrapper_cli-1.2.1.tar.gz.

File metadata

  • Download URL: repo_scrapper_cli-1.2.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for repo_scrapper_cli-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5f2d99893362f1272ffb84ffffe0c5ac009b98d5e099fa2c3a36ef419e204ef7
MD5 19b99cd03b9b4323b359dc492c198ffb
BLAKE2b-256 d5b9a453ddf2486db76092f10ed88c6bb0a807e530504889eb6a725380991343

See more details on using hashes here.

File details

Details for the file repo_scrapper_cli-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for repo_scrapper_cli-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3034a6589ae0545de14b0722639a7b2e54ae822dced63e070855481fcf6b23bc
MD5 d98598675d8aa2bcb16c57699d87edf6
BLAKE2b-256 2ef833cf3b6102520a5605c9c6eb907e811210cb7348f9e60985c5c209d74b62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page