A fast Python dependency analyzer that automatically discovers and extracts third-party imports
Project description
depfinder 🔍
A fast Python dependency analyzer that automatically discovers and extracts third-party imports from your Python projects. It uses parallel processing to quickly scan your codebase and identify all external dependencies.
Features ✨
- Fast parallel file processing using
ProcessPoolExecutor - Intelligent package name mapping (e.g.,
PIL→pillow,cv2→opencv-python) - Excludes standard library imports automatically
- Generates
requirements.txtfile - Support for both single files and directories
- Smart handling of local module imports
Installation 📦
pip install depfinder
Usage 🚀
Basic usage to analyze a directory and generate requirements.txt:
python -m definder src/
Analyze multiple paths:
python -m definder src/ tests/ scripts/
Options:
python -m definder src/ --no-save # Don't generate requirements file
python -m definder src/ --workers 4 # Specify number of parallel workers
How it Works 🛠️
- Recursively scans all Python files in specified directories
- Uses AST parsing to safely extract imports
- Filters out standard library and local module imports
- Maps import names to correct PyPI package names
- Generates a clean requirements file
Output 📝
The tool will:
- Show all scanned files
- List discovered third-party dependencies
- Generate a
requirements.txtfile (orrequirements-definder.txtif the former exists)
License 📄
[License information here]
Contributing 🤝
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file definder-0.1.0.tar.gz.
File metadata
- Download URL: definder-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497208c39e0f220e8c44a6e8dae4381748cb0394552c9f849156c88e7d12ec98
|
|
| MD5 |
42e587a67959bb6a8c594782e29299dc
|
|
| BLAKE2b-256 |
47e2fd8236b8f0da1b73eecc527c747a62ee6d721c169b25ab4235693e834ecc
|
File details
Details for the file definder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: definder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6fd7b03b1729d83d95cdcffa362d967a1082984f3526fb47f503269785cb6c5
|
|
| MD5 |
7bfd012aea0dda15f608b5eb4dca9693
|
|
| BLAKE2b-256 |
ae93b508e65dc20b06e524e191fc5318f0d3e8088838e7593e43ce8afe1e4d41
|