Skip to main content

PyReqify

Python
License GitHub Badge

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 .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 to generate a requirements.txt in 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)

Source distribution for pyreqify 0.0.11
File Size Uploaded
pyreqify-0.0.11.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyreqify 0.0.11
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page