A (not quite) flexible command framework
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.1.post1.tar.gz
(10.4 kB
view hashes)
Built Distribution
Close
Hashes for cmdtools_py-3.0.1.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18bbbe1b598bc72336c26c3703cebbe0c03d7c0c2f1c92f139023a60d23b95b8 |
|
MD5 | a4235412d5aafe424b465ed14e1576f1 |
|
BLAKE2b-256 | 7f1dc0b639fa8b7038a1536b545761d23666136da94b19e3309a1d60e21aa182 |