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.dev6.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for cmdtools_py-3.0.0.dev6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd2268944c9a4e0b22d0523593cc75aec11f77cf7ad88d9e922cbb7b1594f72d |
|
MD5 | 83b1d170f9b8f9e29366f8d12a217718 |
|
BLAKE2b-256 | 0e2f92f73fb9b50fa1c42622b38b2cf715db9a4678d3a7d7341628d776183324 |