Powered by FastAPI + pipreqs. Specifically, FastAPI runs the API server for receiving requests and pipreqs does the code requirements assessing.
Basic API to power bots / helpers to rid the world of Python projects without correct requirements!
Attempts to shallow git clone a given repo then run pipreqs on the codebase.
Returns the resulting requirements.txt contents!
NOTE: Caches responses for a given url for 5 minutes or until it is evicted by LRU policy
- Use the pyscript frontend on github pages
- Use the Streamlit frontend 🎈
- Use the fastapi generated swagger docs
- Use
curlor other http client
curl "https://pipreqs-api.herokuapp.com/pipreqs?code_url=https://github.com/gerardrbentley/pipreqs-api"Response
cachetools==5.0.0
fastapi==0.75.2
httpx==0.22.0
pydantic==1.9.0
pytest==7.1.2
streamlit==1.8.1
uvicorn==0.17.6- 🧪 Generation Options:
- Strict / Unpinned / Compatible / Greater Than options
- Alternate PyPi server
- Use requirements data to make conda
environment.ymlorpyproject.toml
- 🤖 API Options:
- Caching
- Cache Busting
- Auto open Github Pull Request with updated requirements
- Allow partial repo / branch urls instead of full git url
- Safe way to allow zip fetch / analysis?
- 📺 Frontend:
- Streamlit app for requesting repo(s)
- Deployed on separate branch
streamlit_deployto contain requirements
- Copy or Rename
.env.exampleas.env.dev
mv .env.example .env.devRequires docker-compose to be installed (this comes with Docker Desktop).
make run
# Open localhost:8000/health# Linting
make lint
# Unit Testing
make test
# Display coverage report after test (uses local python, not docker)
make coverageFor code completion / linting / developing / etc.
make install
. ./venv/bin/activate
cd backend