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.dev4.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for cmdtools_py-3.0.0.dev4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94354352134960e03353f4258dfb6fce0931df2f0778d47aed35e95bbbace981 |
|
MD5 | 77bd39944e7ce324e7dd4d8db9f2eeb9 |
|
BLAKE2b-256 | e823ef631aa48a5ed8f22dadaac0770428ac1bc0aadee1190ed5a11a0bc80b81 |