A (not quite) flexible command framework
Project description
Installation
pip install --upgrade cmdtools-py
install the latest commit from GitHub
pip install git+https://github.com/HugeBrain16/cmdtools.git
Basic example
import asyncio
import cmdtools
@cmdtools.callback.add_option("message")
def send(ctx):
print(ctx.options.message)
@send.error
def error_send(ctx):
if isinstance(ctx.error, cmdtools.NotEnoughArgumentError):
if ctx.error.option == "message":
print("Message is required!")
cmd = cmdtools.Cmd('/send hello')
asyncio.run(cmdtools.execute(cmd, send))
Links
PyPI project: https://pypi.org/project/cmdtools-py
Repository: https://github.com/HugeBrain16/cmdtools
Issues tracker: https://github.com/HugeBrain16/cmdtools/issues
Documentation: https://cmdtools-py.readthedocs.io/en/latest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cmdtools_py-3.1.0.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmdtools_py-3.1.0.tar.gz.
File metadata
- Download URL: cmdtools_py-3.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c302b5b664661e8a0ecfc05ef63b75fba00ae9c20fe3a0eb202f3d3109d799
|
|
| MD5 |
a0b18e7ed70d8307394f672a741d70af
|
|
| BLAKE2b-256 |
d5eb211bd481df6303f6a582499716b9693a83e98788ce7cadb1aee70bc6605a
|
File details
Details for the file cmdtools_py-3.1.0-py3-none-any.whl.
File metadata
- Download URL: cmdtools_py-3.1.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1a96a497e453f36eebe4224de1192fd504d06613f0092efbe874e42c8f4a7ec
|
|
| MD5 |
ca6f50bf6642b7ae9d2523abd844bb09
|
|
| BLAKE2b-256 |
8652774b6af08f881da881fa9557edca5747e971d75e901d1afd63646b3d81de
|