Skip to main content

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., PILpillow, cv2opencv-python)
  • Excludes standard library imports automatically
  • Generates requirements.txt file
  • 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 🛠️

  1. Recursively scans all Python files in specified directories
  2. Uses AST parsing to safely extract imports
  3. Filters out standard library and local module imports
  4. Maps import names to correct PyPI package names
  5. Generates a clean requirements file

Output 📝

The tool will:

  1. Show all scanned files
  2. List discovered third-party dependencies
  3. Generate a requirements.txt file (or requirements-definder.txt if the former exists)

License 📄

[License information here]

Contributing 🤝

Contributions are welcome! Please feel free to submit a Pull Request.

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

definder-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

definder-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for definder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 497208c39e0f220e8c44a6e8dae4381748cb0394552c9f849156c88e7d12ec98
MD5 42e587a67959bb6a8c594782e29299dc
BLAKE2b-256 47e2fd8236b8f0da1b73eecc527c747a62ee6d721c169b25ab4235693e834ecc

See more details on using hashes here.

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

Hashes for definder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6fd7b03b1729d83d95cdcffa362d967a1082984f3526fb47f503269785cb6c5
MD5 7bfd012aea0dda15f608b5eb4dca9693
BLAKE2b-256 ae93b508e65dc20b06e524e191fc5318f0d3e8088838e7593e43ce8afe1e4d41

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