Python Tools Scripts (ptscripts) is a command-line interface (CLI) tool designed to simplify the creation and management of project-specific scripts. It functions similarly to `invoke` but leverages `argparse` internally for CLI argument definition. The library discovers and integrates scripts placed within a designated 'tools' package in a repository's root, making them accessible via a central `tools` command. It is currently at version 0.20.5 and appears to have an active maintenance cadence, with the latest release in early 2024.
pip install python-tools-scriptsVerified import paths — ran on the pinned version, not inferred.
To use `python-tools-scripts`, create a `tools` directory in your repository's root and ensure it's a Python package (contains `__init__.py`). Define your CLI commands within Python files inside this `tools` package using `@command_group` and `@command` decorators from `ptscripts`. These scripts will then be discoverable and executable via the `tools` command-line utility. Ensure you import your script files into `tools/__init__.py` for them to be picked up.
Always use `from ptscripts import ...` for imports after installing `python-tools-scripts`.
Create a `tools` directory at your project root. Add an empty `__init__.py` file to make it a package. For each script `my_script.py` in `tools/`, add `from . import my_script` to `tools/__init__.py`.
Ensure the library is installed with `pip install python-tools-scripts`. Verify that the import statement is `from ptscripts import ...`.
Check that your `tools` directory is at the repository root, contains an `__init__.py` file, and that your script file (e.g., `my_script.py`) is imported within `tools/__init__.py`. Also, ensure the `@command_group` decorator has the correct `name` argument matching the command you're trying to execute.
No dependency data recorded yet.