requmancer


Namerequmancer JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/ParisNeo/requmancer
SummaryA tool to generate requirements files from Python projects
upload_time2024-07-19 17:29:47
maintainerNone
docs_urlNone
authorParisNeo
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Requmancer

Requmancer is a powerful Python library and command-line tool that analyzes your Python project and generates a comprehensive requirements file. It automatically detects imported packages, determines their versions, and creates either a pip-compatible `requirements.txt` or a Poetry-style `pyproject.toml` section.

With Requmancer, managing your project's dependencies becomes a breeze, ensuring reproducibility and easier setup for other developers.

## Features

- Automatically detects third-party imports in your Python project.
- Determines the installed versions of the imported packages.
- Generates a `requirements.txt` file for pip or a `pyproject.toml` section for Poetry.
- Handles both absolute and relative imports.
- Excludes standard library modules from the requirements file.

## Installation

You can install Requmancer using pip:

```bash
pip install requmancer
```

## Usage

Requmancer can be used both as a command-line tool and as a Python library.

### Command-Line Usage

To generate a `requirements.txt` file for your project, navigate to the root directory of your project and run:

```bash
requmancer .
```

You can specify the output file name and format using the `-o` and `-f` options:

```bash
requmancer . -o requirements.txt -f pip
requmancer . -o pyproject.toml -f poetry
```

### Python Library Usage

You can also use Requmancer as a Python library in your own scripts:

```python
from requmancer.main import RequirementsGenerator

generator = RequirementsGenerator(directory='path/to/your/project', output_file='requirements.txt', format='pip')
generator.generate()
```

## Example

Suppose you have a Python project with the following structure:

```
my_project/
├── main.py
├── module/
│   └── submodule.py
└── requirements.txt
```

And the `main.py` file contains:

```python
import requests
import numpy as np
```

Running `requmancer .` in the `my_project` directory will generate a `requirements.txt` file with the following content:

```
requests==2.25.1
numpy==1.19.5
```

## Development

To contribute to Requmancer, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/ParisNeo/requmancer.git
cd requmancer
```

2. Create a virtual environment and activate it:

```bash
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
```

3. Install the development dependencies:

```bash
pip install -r requirements_dev.txt
```

4. Run the tests:

```bash
pytest
```

## License

Requmancer is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.

## Author

Requmancer is developed and maintained by [ParisNeo](https://github.com/ParisNeo).

## Acknowledgements

Special thanks to the open-source community for providing the tools and libraries that made this project possible.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ParisNeo/requmancer",
    "name": "requmancer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "ParisNeo",
    "author_email": "parisneoai@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/c8/7499aca6ec0256d6cd06a30a42c66c2af0eff544953ba5ebf3db8ebc61d8/requmancer-0.1.0.tar.gz",
    "platform": null,
    "description": "# Requmancer\r\n\r\nRequmancer is a powerful Python library and command-line tool that analyzes your Python project and generates a comprehensive requirements file. It automatically detects imported packages, determines their versions, and creates either a pip-compatible `requirements.txt` or a Poetry-style `pyproject.toml` section.\r\n\r\nWith Requmancer, managing your project's dependencies becomes a breeze, ensuring reproducibility and easier setup for other developers.\r\n\r\n## Features\r\n\r\n- Automatically detects third-party imports in your Python project.\r\n- Determines the installed versions of the imported packages.\r\n- Generates a `requirements.txt` file for pip or a `pyproject.toml` section for Poetry.\r\n- Handles both absolute and relative imports.\r\n- Excludes standard library modules from the requirements file.\r\n\r\n## Installation\r\n\r\nYou can install Requmancer using pip:\r\n\r\n```bash\r\npip install requmancer\r\n```\r\n\r\n## Usage\r\n\r\nRequmancer can be used both as a command-line tool and as a Python library.\r\n\r\n### Command-Line Usage\r\n\r\nTo generate a `requirements.txt` file for your project, navigate to the root directory of your project and run:\r\n\r\n```bash\r\nrequmancer .\r\n```\r\n\r\nYou can specify the output file name and format using the `-o` and `-f` options:\r\n\r\n```bash\r\nrequmancer . -o requirements.txt -f pip\r\nrequmancer . -o pyproject.toml -f poetry\r\n```\r\n\r\n### Python Library Usage\r\n\r\nYou can also use Requmancer as a Python library in your own scripts:\r\n\r\n```python\r\nfrom requmancer.main import RequirementsGenerator\r\n\r\ngenerator = RequirementsGenerator(directory='path/to/your/project', output_file='requirements.txt', format='pip')\r\ngenerator.generate()\r\n```\r\n\r\n## Example\r\n\r\nSuppose you have a Python project with the following structure:\r\n\r\n```\r\nmy_project/\r\n\u251c\u2500\u2500 main.py\r\n\u251c\u2500\u2500 module/\r\n\u2502   \u2514\u2500\u2500 submodule.py\r\n\u2514\u2500\u2500 requirements.txt\r\n```\r\n\r\nAnd the `main.py` file contains:\r\n\r\n```python\r\nimport requests\r\nimport numpy as np\r\n```\r\n\r\nRunning `requmancer .` in the `my_project` directory will generate a `requirements.txt` file with the following content:\r\n\r\n```\r\nrequests==2.25.1\r\nnumpy==1.19.5\r\n```\r\n\r\n## Development\r\n\r\nTo contribute to Requmancer, follow these steps:\r\n\r\n1. Clone the repository:\r\n\r\n```bash\r\ngit clone https://github.com/ParisNeo/requmancer.git\r\ncd requmancer\r\n```\r\n\r\n2. Create a virtual environment and activate it:\r\n\r\n```bash\r\npython -m venv venv\r\nsource venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\r\n```\r\n\r\n3. Install the development dependencies:\r\n\r\n```bash\r\npip install -r requirements_dev.txt\r\n```\r\n\r\n4. Run the tests:\r\n\r\n```bash\r\npytest\r\n```\r\n\r\n## License\r\n\r\nRequmancer is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\r\n\r\n## Author\r\n\r\nRequmancer is developed and maintained by [ParisNeo](https://github.com/ParisNeo).\r\n\r\n## Acknowledgements\r\n\r\nSpecial thanks to the open-source community for providing the tools and libraries that made this project possible.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tool to generate requirements files from Python projects",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ParisNeo/requmancer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5990fd4fc2d6f52fae892ac2b1d8498b66060537ae2c6a301295ee660da7d417",
                "md5": "a9a185c2cd62c2b319a4886f2e7f8bde",
                "sha256": "f5cc4fe8b364d12415f6b473322f6921dea50053c4928850654c6e3ff0cc2bb2"
            },
            "downloads": -1,
            "filename": "requmancer-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9a185c2cd62c2b319a4886f2e7f8bde",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9460,
            "upload_time": "2024-07-19T17:29:46",
            "upload_time_iso_8601": "2024-07-19T17:29:46.295284Z",
            "url": "https://files.pythonhosted.org/packages/59/90/fd4fc2d6f52fae892ac2b1d8498b66060537ae2c6a301295ee660da7d417/requmancer-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ac87499aca6ec0256d6cd06a30a42c66c2af0eff544953ba5ebf3db8ebc61d8",
                "md5": "bfa5ad8545136160f17a3879ff06d826",
                "sha256": "88fad994c340878d04f33c4aa35b8fea531a1c43f87294ed382f5571c8a5c74a"
            },
            "downloads": -1,
            "filename": "requmancer-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bfa5ad8545136160f17a3879ff06d826",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8637,
            "upload_time": "2024-07-19T17:29:47",
            "upload_time_iso_8601": "2024-07-19T17:29:47.821072Z",
            "url": "https://files.pythonhosted.org/packages/6a/c8/7499aca6ec0256d6cd06a30a42c66c2af0eff544953ba5ebf3db8ebc61d8/requmancer-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-19 17:29:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ParisNeo",
    "github_project": "requmancer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "setuptools",
            "specs": [
                [
                    ">=",
                    "58.0.0"
                ]
            ]
        }
    ],
    "lcname": "requmancer"
}
        
Elapsed time: 0.39610s