# reqgenz

```bash
usage: reqgenz.py [-h] [--output_directory OUTPUT_DIRECTORY] [--env-name ENV_NAME] [--list-envs] [--no-env] [--project-name PROJECT_NAME] [--project-description PROJECT_DESCRIPTION]
                 [--project-author PROJECT_AUTHOR] [--pin PIN] [--skip-install] [--merge-requirements] [--dev] [--pipfile] [--verbose] [--bump {major,minor,patch}] [--log-file LOG_FILE]
                 [--dockerfile] [--visualize-graph] [--main-script MAIN_SCRIPT] [--package-manager {uv,poetry,pip}] [--python-env-version PYTHON_ENV_VERSION [PYTHON_ENV_VERSION ...]]
                 [--activate-env ACTIVATE_ENV] [--deactivate-env DEACTIVATE_ENV] [--create-reqs-file] [--create-pyproject]
                 source_directory

Requirements Generator Tool: Manage requirements, versioning, and virtual environments for Python projects.

positional arguments:
  source_directory      Directory to recursively search for Python files and generate requirements from imports.

optional arguments:
  -h, --help            show this help message and exit
  --output_directory OUTPUT_DIRECTORY
                        Directory to save generated files.
  --env-name ENV_NAME   Specify the name of the virtual environment to create (default: 'env').
  --list-envs           List all virtual environments.
  --no-env              Skip creating a virtual environment and install dependencies in the global Python environment.
  --project-name PROJECT_NAME
                        Set the project name for pyproject.toml (default: 'auto_generated_project').
  --project-description PROJECT_DESCRIPTION
                        Set the project description for pyproject.toml (default: 'A project generated by RequirementsGenerator').
  --project-author PROJECT_AUTHOR
                        Set the project author for pyproject.toml (default: 'Your Name <you@example.com>').
  --pin PIN             Pin a dependency to a specific version. Usage: --pin package==version. Can be used multiple times.
  --skip-install        Skip the installation of dependencies after generating requirements.
  --merge-requirements  Merge newly detected dependencies into an existing requirements.txt file, instead of overwriting it.
  --dev                 Include development dependencies (like pytest, black) in pyproject.toml.
  --pipfile             Generate a Pipfile for pipenv users (in addition to requirements.txt and pyproject.toml).
  --verbose             Enable verbose logging for detailed output during the execution.
  --bump {major,minor,patch}
                        Bump the version in pyproject.toml:
                          major: Increment the major version (e.g., 1.0.0 -> 2.0.0)
                          minor: Increment the minor version (e.g., 1.1.0 -> 1.2.0)
                          patch: Increment the patch version (e.g., 1.1.1 -> 1.1.2)
  --log-file LOG_FILE   Specify a log file to save logs.
  --dockerfile          Generate a Dockerfile for the project.
  --visualize-graph     Visualize the dependency graph.
  --main-script MAIN_SCRIPT
                        Specify the main script to run in the Docker container (default: 'your_script.py').
  --package-manager {uv,poetry,pip}
                        Specify the package manager to use (default: 'pip').
  --python-env-version PYTHON_ENV_VERSION [PYTHON_ENV_VERSION ...]
                        Specify the Python versions to use for the virtual environments (default: 'python3').
  --activate-env ACTIVATE_ENV
                        Activate a specific virtual environment by specifying the env path.
  --deactivate-env DEACTIVATE_ENV
                        Deactivate virtual environment.
  --create-reqs-file    Create a requirements.txt file.
  --create-pyproject    Create a pyproject.toml file.
```


## installation
```bash
curl -sSf https://raw.githubusercontent.com/webcoderz/reqgenz/main/install.sh | bash
```
or
```bash
git clone https://github.com/webcoderz/reqgenz.git
cd reqgenz
python3 reqgenz/src/reqgenz.py
```
or
```bash
pip install reqgenz
```

## how to use
this script utilizes python standard library and does not require any additional dependencies, any additional dependencies are installed depending on the options you choose. (uv,poetry,matplotlib,networkx)