PyReqify
A lightweight Python module for requirements.txt generation. It 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 to generate a
requirements.txtin the current directory with all extracted dependencies.
pyreqify <source_folder> <destination folder> --include-source-pyversion
generated requirement.txt file
scikit-learn==1.5.1
keras==3.6.0
numpy==2.0.1
pandas==2.2.2
open3d==0.16.1
webcolors==24.8.0
nbformat==5.10.4
matplotlib==3.9.1
typing==3.7.4.3
torch==2.2.2
python==3.10.14
Examples
Example 1: Generate requirements.txt in the current working folder without the Python version.
pyreqify ~/Workspace/project .
Example 2: Generate requirements.txt in the deploy folder, including the Python module versions and Python version in the file.
pyreqify ~/Workspace/project ~/Workspace/project/deploy --include-module-version --include-source-pyversion
Metadata
Release files for pyreqify 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyreqify-0.0.11.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyreqify-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / pyreqify-0.0.11.tar.gz
| Download URL | pyreqify-0.0.11.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
243794c45460bf18363e89dd35f0169bfa22cbea9db605660a8636dfb25f6c90
|
|
BLAKE2b-256 checksum How to use checksums |
3dda96b6d31dd362d861ddcd87733be85de741b47e3b8821b49acdc5f4ce1be7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / pyreqify-0.0.11-py3-none-any.whl
| Download URL | pyreqify-0.0.11-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a67f127498c9a9cc95a26c836f951c70123ae218f34f27dfa6a18115b153d412
|
|
BLAKE2b-256 checksum How to use checksums |
35a0032fcf3595479d0c4157d3adc5ba074ed4a5ea1240fcb72347dbf01512ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|