Skip to main content

A Python package for automatically detecting project dependencies

Project description

AutoDPD (Automatic Dependency Detector)

PyPI

AutoDPD is a Python tool that automatically analyzes Python projects to detect dependencies, determine required Python versions, and generate environment package list.

Features

🔍 Automatic Dependency Detection from:

  • Python files (*.py)
  • Jupyter notebooks (*.ipynb)
  • Local imports
  • Common package aliases (e.g., 'cv2' → 'opencv-python')

🔧 Environment Generation:

  • environment.yml for conda
  • requirements.txt for pip

Installation

pip install pyyaml requests packaging
pip install autodpd

Tutorials

Basic Usage

cd /path/to/your/project
autodpd # Generate Dependencies
conda env create -f environment.yml # default name: the name of current dir e.g. "project"; you can personalize your own conda env name after "name:" 
conda activate PROJECT_NAME # Enter the name in environment.yml
pip install -r requirements.txt # Ensure you installed all dependencies

environment.yml:

name: project_name
channels:
  - defaults
  - conda-forge
dependencies:
  - python>=3.6
  - pip
  - pip:
    - matplotlib
    - numpy
    - pandas
    - scikit-learn
    - tensorflow

requirements.txt:

# Python >= 3.6
matplotlib
numpy
pandas
scikit-learn
tensorflow

Check the current version of autodpd:

autodpd -v

environment.yml:

name: project_name
channels:
  - defaults
  - conda-forge
dependencies:
  - python>=3.6
  - pip
  - pip:
    - matplotlib==3.4.3
    - numpy==1.21.2
    - pandas==1.3.3
    - scikit-learn==0.24.2
    - tensorflow==2.6.0

requirements.txt:

# Python >= 3.6
matplotlib==3.4.3
numpy==1.21.2
pandas==1.3.3
scikit-learn==0.24.2
tensorflow==2.6.0

Analyze specific directory:

autodpd -d /path/to/your/project

Include recommended version of dependencies:

autodpd --versions

Generate with a quiet output:

autodpd -q

Skip saving output files:

autodpd --no-save 

(Optional) Python API

from autodpd import autodpd

# Initialize detector
detector = autodpd()

# Generate environment specifications
specs = detector.generate_environment(
    directory='path/to/project',
    include_versions=True
)

# Access results
python_version = specs['recommended_python_version']
dependencies = specs['dependencies']

Contributions

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

autodpd-0.2.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

autodpd-0.2.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file autodpd-0.2.1.tar.gz.

File metadata

  • Download URL: autodpd-0.2.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for autodpd-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eeac7fd42199f6a1d55a5abe59d9ccf207701e1635f29bc68314767f586cb304
MD5 f4be98878b5968e3fa1178c5f99c5f7c
BLAKE2b-256 abfd4d6261cf54a7602c9586555d546b3e9be9a28e7650dc33c445e1e8320f6a

See more details on using hashes here.

File details

Details for the file autodpd-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: autodpd-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for autodpd-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26aa092fe723cccc9c34a0e66c28270bbba58f95d791e1e2e5a0f25f7def0e71
MD5 a4280836257f32faf723732c80d8f7b8
BLAKE2b-256 c0697bbcd6c8b4e862657bede2c2f0c4eda37c4dcf3c17d1be010675cf5385bc

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