petcmd
Installation
petcmd can be installed with pip:
python -m pip install petcmd
You can also download the project source and do:
pip install .
Dependencies
petcmd was created as a lightweight package, so there are no dependencies.
Examples
from petcmd import Commander
commander = Commander()
@commander.command("calc")
def calculate(a: int, b: int, operator: str = "+"):
print(eval(f"{a} {operator} {b}"))
if __name__ == "__main__":
commander.process()
$ python app.py calc 1 2
3
$ python app.py calc 10 2 /
5.0
$ python app.py calc 10 2 -o /
5.0
$ python app.py calc 10 2 --operator /
5.0
$ python app.py calc -a 10 -b 2 --operator /
5.0
Documentation
Documentation is available at https://petcmd.readthedocs.io/en/latest/
Testing
python -m tests
Release files for petcmd 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| petcmd-1.0.5.tar.gz | 12.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| petcmd-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.1 kB
Release files / petcmd-1.0.5.tar.gz
| Download URL | petcmd-1.0.5.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
993f8ab6801bd94deab3765b7496aed6aadbdab4fca91886d5a63784e2467251
|
|
BLAKE2b-256 checksum How to use checksums |
bedc7a4e467c337ead6baaad833b39eeba3ee49a7c021a74b4d8d5544e1ce52f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / petcmd-1.0.5-py3-none-any.whl
| Download URL | petcmd-1.0.5-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4aa1891123e5bcbe6787905a15f119ef72a87cfd867c64261a10269e4d02fece
|
|
BLAKE2b-256 checksum How to use checksums |
482f653fc03dd3b224669d176249ed091894f74bd0749c0b956daa4c32f14f39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|