command text parser and command processor
Project description
Installation
pip install --upgrade cmdtools-py
install 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
Source code: 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.0.0.dev7.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for cmdtools_py-3.0.0.dev7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36359211a5ac5de9b0198a59d2c379791ceaadfb82c46b4bd8d697d2a483b8b2 |
|
MD5 | 894e2e1c0ee61adb43400edf460b8012 |
|
BLAKE2b-256 | eb44be7eee12b6163afc06784e056b22cfb7afaf9d729799bac96c7cb16cb8c7 |