Skip to main content

A module to extract and package Python dependencies

Project description

PyReqify

Python
License GitHub Badge

A lightweight Python module that efficiently extracts imported modules and generates a requirements.txt file with module versions for .py and .ipynb files in a given directory. Simplify dependency management for your projects!

Features

  • 📦 Automatic Module Extraction: Scans .py and .ipynb files in a directory to find all imported modules.
  • 🔍 Version Detection: Fetches installed versions of imported modules (maps common aliases to official package names). It also gives the option to includes fetch source python version too.
  • 📝 Requirements Generation: Creates a requirements.txt file with all extracted dependencies and the current Python version.

Installation

Clone this repository and install the requirements.

pip install pyreqify

ExtractPackages

Usage

To use the pyreqify function and automatically create a requirements.txt file:

  1. Place all .py and .ipynb files in a folder (e.g., project).
  2. Run the function, which will generate a requirements.txt in the current directory with all extracted dependencies.
pyreqify <source_folder> <destination folder> --include-source-pyversion
#Example 1: generating requirement.txt in the current working folder with no python version included
pyreqify ~/Workspace/project . 

#Example 2: generating requirement.txt in the deploy folder working folder along with the working python version included in the .txt
pyreqify ~/Workspace/project ~/Workspace/project/deploy --include-source-pyversion

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

pyreqify-0.0.6.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

pyreqify-0.0.6-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyreqify-0.0.6.tar.gz.

File metadata

  • Download URL: pyreqify-0.0.6.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pyreqify-0.0.6.tar.gz
Algorithm Hash digest
SHA256 dd72dc926e0259da9b8328997f3a5de313f7d13c3fa56909e3e3779dd2124644
MD5 c3ba748544135c4056d8aed6408e81fb
BLAKE2b-256 fcb850badc4bf2912122fb002bc512e6bf2074f4efb4ab3601fcf294881473f2

See more details on using hashes here.

File details

Details for the file pyreqify-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: pyreqify-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pyreqify-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 045fa4b38c2db0fbceafceaf419612f3584424886686de8342a331e900518e95
MD5 4f45823365c7de97130614e253a944e4
BLAKE2b-256 b7040fbf618ee79d7b680526ea5537a0e39bcac90a1a0882ac87a29eb819ef5c

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