Skip to main content

A dynamic requirements.txt builder that sifts through AST imports.

Project description

🦆 ReqScan — Auto-generate requirements.txt in one command

"I got tired of manually tracking every import across every project. So I automated the suffering away."


😤 The Problem

You know the drill. You've been smacking away on your keyboard for weeks. It's beautiful. It works. You're proud. Then someone says:

"Hey, can you send me the requirements?"

And suddenly you're doing archaeology on your own code. Scrolling through 30 files. Squinting at imports. Trying to remember if you actually used requests or just thought about it. Manually checking versions. Forgetting one. Breaking their environment. Apologizing.

No more. Just cd in and run reqscan. Done.


🚀 Install

pip install reqscan

⚡ Usage

Navigate to your project and run:

reqscan

That's it. It scans the current directory, figures out what you actually imported, and writes a clean versioned requirements.txt right there.

You can also point it at a specific folder:

reqscan /path/to/my/project

And if you want to blow away an existing requirements.txt without being asked:

reqscan --overwrite

📋 Example Output

requirements.txt
────────────────
fastapi==0.111.0
httpx==0.27.0
pydantic==2.7.1
rich==13.7.1
uvicorn==0.29.0

Clean. Sorted. Versioned. Done.


✨ What It Does

  • 🔍 Recursively scans your entire project tree for .py files
  • 🧠 Classifies imports — filters out stdlib modules and local files so you don't end up with os==3.11 in your requirements
  • Parallel parsing — uses multiprocessing to chew through large projects fast, with a live progress bar
  • 🔄 Non-destructive by default — merges with your existing requirements.txt instead of nuking it
  • 🚫 Skips the junk — ignores venv, .venv, node_modules, __pycache__, build, dist, and all the other folders we don't talk about
  • 🪟 Windows compatible — ANSI colors work there too

🛠 Requirements

  • Python 3.10+
  • No third-party dependencies — reqscan is pure stdlib all the way down

⚠️ Caveats & Known Quirks

  • Dynamic imports (importlib.import_module(...), __import__) won't be detected — reqscan uses static AST analysis
  • Version detection only works for packages installed in your current Python environment — run it from inside your virtualenv for best results
  • Some packages import under a different name than their PyPI name (e.g., import cv2opencv-python). reqscan resolves most of these via package metadata, but the occasional oddball may slip through

🤝 Contributing

Found a bug? Have a wild idea? PRs welcome. This started as a personal itch-scratcher, so there's plenty of room to grow.


📜 License

Do whatever you want with it. Just don't manually maintain a requirements.txt ever again. That's the only rule.


Also available as a full interactive CLI — see ReqScan Github for the complete experience.

Project details


Download files

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

Source Distribution

reqscan-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

reqscan-1.0.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file reqscan-1.0.2.tar.gz.

File metadata

  • Download URL: reqscan-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reqscan-1.0.2.tar.gz
Algorithm Hash digest
SHA256 dbb9aeca1e23c350043a945c76c21ec1b72f3aa21fad9e060cbaa10dac7b8575
MD5 d7d379a426943f4cdb4696d19bacf0d3
BLAKE2b-256 76bd0878dabe728076810f252e6fb063062e752930a6403053af833256ed6409

See more details on using hashes here.

File details

Details for the file reqscan-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: reqscan-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reqscan-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aecdb03152b9ede4c017014c160ffd63206cbb724884f6d94848c180b5bca157
MD5 4cf04d50a626cff2b272506428929a34
BLAKE2b-256 ca40c493ce54119aad22a6150186480ebbd869345852d8f0c2dda6a3741445e5

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