Skip to main content

A module to extract Python dependencies packages from .py and .ipynb

Project description

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

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.11.tar.gz (4.1 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.11-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyreqify-0.0.11.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyreqify-0.0.11.tar.gz
Algorithm Hash digest
SHA256 243794c45460bf18363e89dd35f0169bfa22cbea9db605660a8636dfb25f6c90
MD5 673bfa738595b8a9353038c94d4f438e
BLAKE2b-256 3dda96b6d31dd362d861ddcd87733be85de741b47e3b8821b49acdc5f4ce1be7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyreqify-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyreqify-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a67f127498c9a9cc95a26c836f951c70123ae218f34f27dfa6a18115b153d412
MD5 240c32300b69b58511fc58d81ae3ad7c
BLAKE2b-256 35a0032fcf3595479d0c4157d3adc5ba074ed4a5ea1240fcb72347dbf01512ea

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