This release is a pre-release and may not be stable for production use.
A simple command runner that uses argparse from the Python standard library under the hood. Runs on Python 3 only (3.10 and up). Uses annotations to configure options.
There are two basic use cases:
Standalone console scripts (including scripts with subcommands).
Collections of commands (similar to make, Fabric, etc).
Building on these, especially #2, there are a couple of more advanced use cases:
A simple orchestration/deployment tool. If you have a simple build process and just need to rsync some files to a server, a few simple commands might be all you need.
A wrapper for more sophisticated orchestration/deployment tools–an alternative to the Bash scripts you might use to drive Ansible playbooks and the like.
Basic Usage
Define a command:
from runcommands import arg, command
from runcommands.commands import local
@command
def test(*tests: arg(help='Specific tests to run (instead of using discovery)')):
if tests:
local(('python', '-m', 'unittest', tests))
else:
local('python -m unittest discover .')
Show its help:
> run test -h test [-h] [TESTS [TESTS ...]] positional arguments: TESTS Specific tests to run (instead of using discovery) optional arguments: -h, --help show this help message and exit
Run it:
> run test .......... ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK
Create a standalone console script using a standard script entry point:
# pyproject.toml
[project.scripts]
my-test-script = "package.module:test.console_script"
Reinstall the package to install the script and then run it:
> my-test-script .......... ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK
See the main documentation for more information on installation, defining & running commands, configuration, etc.
Features
Easily create standalone console scripts: simply define a function and wrap it with the @command decorator.
Easily create standalone console scripts that have subcommands (a la git).
Create collections of commands (similar to make, Fabric, etc).
Run multiple commands in sequence: run build deploy.
Uses argparse under the hood so command line usage is familiar.
Provides built-in help/usage for all commands via argparse.
Provides command line completion (including example scripts for bash and fish).
Documentation
Detailed documentation is on Read the Docs.
License
MIT. See the LICENSE file in the source distribution.
TODO
Improve command line completion
Add more documentation and examples
Add more tests (current coverage is 45%)
Metadata
Release files for runcommands 1.0a73
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| runcommands-1.0a73.tar.gz | 39.4 kB | Without provenance | Details for runcommands-1.0a73.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| runcommands-1.0a73-py3-none-any.whl | Python 3 | none | any | Details for runcommands-1.0a73-py3-none-any.whl |
Total release size: 88.6 kB
Release files / runcommands-1.0a73.tar.gz
| Download URL | runcommands-1.0a73.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6c00ab5b8f6d242e6c5acc8751c4502394f8dab05d45594cf9c338bd9a642d2
|
|
BLAKE2b-256 checksum How to use checksums |
b006249ec7103cf072851a43108c6ea836d798092c46fd2a5d4f08ba4e33e430
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / runcommands-1.0a73-py3-none-any.whl
| Download URL | runcommands-1.0a73-py3-none-any.whl |
|---|---|
| Size | 49.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae47506825ff78ef71ac027a5f463dd3a073ae18760962d8a974c608e087ea25
|
|
BLAKE2b-256 checksum How to use checksums |
6e0564093454cb940e94cdf7e0db621ca9be04c3a5b61d8892abba290231f6ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for runcommands 1.0a73
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.