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.post2.tar.gz
(10.4 kB
view hashes)
Built Distribution
Close
Hashes for cmdtools_py-3.0.1.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 173bd754f76364b6ab7840eb6fffbfa40de4b951a77f08df32b04c6d78aee981 |
|
MD5 | c7c04dd9b8fe21c0986b1f7504bc0e14 |
|
BLAKE2b-256 | 908fa742a56e3dbdd8561a9f352fff49daf32151ca1a5ae73b5cba3a3c38921a |