A module to extract and package Python dependencies
Project description
PyReqify
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
.pyand.ipynbfiles 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 versiontoo. - 📝 Requirements Generation: Creates a
requirements.txtfile 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:
- Place all
.pyand.ipynbfiles in a folder (e.g.,project). - Run the function, which will generate a
requirements.txtin 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd72dc926e0259da9b8328997f3a5de313f7d13c3fa56909e3e3779dd2124644
|
|
| MD5 |
c3ba748544135c4056d8aed6408e81fb
|
|
| BLAKE2b-256 |
fcb850badc4bf2912122fb002bc512e6bf2074f4efb4ab3601fcf294881473f2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045fa4b38c2db0fbceafceaf419612f3584424886686de8342a331e900518e95
|
|
| MD5 |
4f45823365c7de97130614e253a944e4
|
|
| BLAKE2b-256 |
b7040fbf618ee79d7b680526ea5537a0e39bcac90a1a0882ac87a29eb819ef5c
|