A simple FastAPI web app that scrapes coding problems from popular platforms based on your prompt, generates .in/.out testcases, and packages everything into a downloadable ZIP. Includes a fast “placeholder mode” for instant results when testing the flow.
- Single-page web UI: enter prompt, pick platforms and difficulty, see live logs and progress.
- Curate results: accept/reject problems, then download a filtered ZIP.
- Live sources: Codeforces implemented; LeetCode, CodeChef, GeeksforGeeks, and AtCoder supported to varying degrees.
- Placeholder mode: instant synthetic problems for quick validation.
- Python 3.11 or higher
- Git
-
Clone the repository
git clone https://github.com/AVPthegreat/codebase-problem-scrapper.git cd codebase-problem-scrapper -
Create and activate a virtual environment
On macOS/Linux:
python3 -m venv .venv source .venv/bin/activateOn Windows:
python -m venv .venv .venv\Scripts\activate
-
Install dependencies
pip install -e '.[dev]' -
Run the web application
python scripts/run_web.py
-
Open your browser
- Navigate to http://127.0.0.1:8000
- Enter a prompt like "Give me 3 easy sorting problems"
- Select platforms and difficulty
- Click "Generate Problems"
- Placeholder Mode: Check the "Use placeholder mode" box for instant synthetic problems (great for testing the UI)
- Platform Selection: Select specific platforms (Codeforces, LeetCode, etc.) or leave all unchecked for all available scrapers
- Problem Curation: After generation, you can accept/reject individual problems and download only selected ones
src/app/services/– Core orchestration and scraperssrc/webapp/– FastAPI app and Jinja templates (index, job, recent)scripts/run_web.py– Local runner (uvicorn)tests/– Smoke tests and a few live scraper checks
- Respect platform ToS: Be mindful when scraping live platforms. Use placeholder mode for demos and testing.
- Local use only: This is designed for localhost. If exposing beyond localhost, add authentication and consider persistent storage.
- Large files: Never commit virtual environments (
.venv*) or output folders to git. The.gitignorefile handles this automatically.
Port already in use?
lsof -ti:8000 | xargs kill -9Missing dependencies?
pip install -e '.[dev]'Tests failing?
pytest tests/- Run
pytestbefore pushing. Keep changes minimal and focused.