Run Run
A typed command line parser for Python.
Example
# main.py
import random
from runrun import Command
from runrun.models import Argument
from runrun.runner import Runner
class RollCommand(Command):
def __init__(self):
super().__init__(
name='roll',
description='Roll a dice',
)
num_of_dice = Argument[int](
name='num',
description='Number of dice to roll',
value=1,
)
faces = Argument[int](
name='faces',
description='how many faces per dice',
value=6,
)
def run(self):
total = 0
for _ in range(self.num_of_dice.value):
total += random.randint(1, self.faces.value)
print(f'🎲 {total}')
Runner(RollCommand()).run()
Run it!
python .\main.py --num 5 --faces 20
Or check the generated help command.
python .\main.py help
Roll a dice
USAGE
roll [arguments]
ARGUMENTS
faces --faces <int> | how many faces per dice
num --num <int> | Number of dice to roll
COMMANDS
Help help | Show help about this command
The help command has it's own help docs !?
python .\main.py help help
Show help about this command
USAGE
roll help [arguments]
ARGUMENTS
Filter --filter <str> | Filter the help results, this can help to find what you are looking for
Output Format --format {STD, JSON} | The output format of the command details
Required Only --required-only [true|false] | Only show required arguments
COMMANDS
Help help | Show help about this command
Finally a help that can be filtered
Metadata
Release files for runrun 0.0.1
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 |
|---|---|---|---|---|
| runrun-0.0.1.tar.gz | 15.7 kB | Without provenance | Details for runrun-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| runrun-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for runrun-0.0.1-py3-none-any.whl |
Total release size: 27.9 kB
Release files / runrun-0.0.1.tar.gz
| Download URL | runrun-0.0.1.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
360d67829ed2e0337af6cda50e2ea2421e0c44da3171f101fc186474cb4a15a5
|
|
BLAKE2b-256 checksum How to use checksums |
c123e5e24ba6e7fd79735347e6ddcc7c78eb70c7f9fd26ba3c37f04bf88f9ca6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / runrun-0.0.1-py3-none-any.whl
| Download URL | runrun-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1f115d8109cf33ff36677cf9ee10c10162a77b71c6f73415e905fcde0135d0d
|
|
BLAKE2b-256 checksum How to use checksums |
02c4adba280d344a9b103cd066d9e772d44c809773c35a752619b7e45fbc8a40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for runrun 0.0.1
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.