pyreqify


Namepyreqify JSON
Version 0.0.8 PyPI version JSON
download
home_pageNone
SummaryA module to extract Python dependencies packages
upload_time2024-11-10 15:36:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Ammar Yasir Naich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python modules automation dependency management requirements requirements.txt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyReqify

[![Python](https://img.shields.io/badge/Python-3.8%2B-blue)](https://www.python.org/)  
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![GitHub Badge](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/ammaryasirnaich/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 `.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.

```bash
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.
```python
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`.
```python
pyreqify ~/Workspace/project .
```

Example 2: Generate `requirements.txt` in the `deploy folder`, including the `Python version` in the file.
```python
pyreqify ~/Workspace/project ~/Workspace/project/deploy --include-source-pyversion
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyreqify",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Python modules, automation, dependency management, requirements, requirements.txt",
    "author": null,
    "author_email": "Ammar Yasir Naich <ammar.naich@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e7/fe/7df4358a0243f910cba59e94545876760da308517fd7f68de7eac663a7e3/pyreqify-0.0.8.tar.gz",
    "platform": null,
    "description": "# PyReqify\n\n[![Python](https://img.shields.io/badge/Python-3.8%2B-blue)](https://www.python.org/)  \n[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![GitHub Badge](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/ammaryasirnaich/PyReqify)\n\n\nA 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!\n\n\n\n\n## Features\n\n- \ud83d\udce6 **Automatic Module Extraction**: Scans `.py` and `.ipynb` files in a directory to find all imported modules.\n- \ud83d\udd0d **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.\n- \ud83d\udcdd **Requirements Generation**: Creates a `requirements.txt` file with all extracted dependencies and the current Python version.\n\n\n## Installation\n\nClone this repository and install the requirements.\n\n```bash\npip install pyreqify\n```\n\n\n# ExtractPackages\n\n## Usage\nTo use the `pyreqify` function and automatically create a `requirements.txt` file:\n\n1. Place all `.py` and `.ipynb` files in a folder (e.g., `project`).\n2. Run the function, which will generate a `requirements.txt` in the current directory with all extracted dependencies.\n```python\npyreqify <source_folder> <destination folder> --include-source-pyversion\n```\n\n##### generated requirement.txt file\n```\n\nscikit-learn==1.5.1\nkeras==3.6.0\nnumpy==2.0.1\npandas==2.2.2\nopen3d==0.16.1\nwebcolors==24.8.0\nnbformat==5.10.4\nmatplotlib==3.9.1\ntyping==3.7.4.3\ntorch==2.2.2\npython==3.10.14\n```\n\n\n#### Examples\nExample 1: Generate `requirements.txt` in the current working folder `without the Python version`.\n```python\npyreqify ~/Workspace/project .\n```\n\nExample 2: Generate `requirements.txt` in the `deploy folder`, including the `Python version` in the file.\n```python\npyreqify ~/Workspace/project ~/Workspace/project/deploy --include-source-pyversion\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Ammar Yasir Naich  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A module to extract Python dependencies packages",
    "version": "0.0.8",
    "project_urls": {
        "Documentation": "https://github.com/ammaryasirnaich/PyReqify",
        "Homepage": "https://github.com/ammaryasirnaich/PyReqify",
        "Source Code": "https://github.com/ammaryasirnaich/PyReqify"
    },
    "split_keywords": [
        "python modules",
        " automation",
        " dependency management",
        " requirements",
        " requirements.txt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e29a93b2219c41510857ded4c00770b1b8a6bf92ac67ec717c634c7ccc0e57e",
                "md5": "4ecd000d8624272edb9c06f393061373",
                "sha256": "35824408b1bfd856f8ff74e11ca747618241d93dc7e37570eccb0883ba1372e9"
            },
            "downloads": -1,
            "filename": "pyreqify-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4ecd000d8624272edb9c06f393061373",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5481,
            "upload_time": "2024-11-10T15:36:17",
            "upload_time_iso_8601": "2024-11-10T15:36:17.820422Z",
            "url": "https://files.pythonhosted.org/packages/2e/29/a93b2219c41510857ded4c00770b1b8a6bf92ac67ec717c634c7ccc0e57e/pyreqify-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7fe7df4358a0243f910cba59e94545876760da308517fd7f68de7eac663a7e3",
                "md5": "0160388c06b783aa420d36e1786c2182",
                "sha256": "fb2550d6961fd2d2c8b54943451eca7a680ecd9b8b78f42e5925a20eec1a2e3d"
            },
            "downloads": -1,
            "filename": "pyreqify-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "0160388c06b783aa420d36e1786c2182",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4535,
            "upload_time": "2024-11-10T15:36:18",
            "upload_time_iso_8601": "2024-11-10T15:36:18.782266Z",
            "url": "https://files.pythonhosted.org/packages/e7/fe/7df4358a0243f910cba59e94545876760da308517fd7f68de7eac663a7e3/pyreqify-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-10 15:36:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ammaryasirnaich",
    "github_project": "PyReqify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyreqify"
}
        
Elapsed time: 2.26163s