https://github.com/programminglaboratorys/commandkit
easy tool to parse string to commands, easy tool to create commandlines
https://github.com/programminglaboratorys/commandkit
Last synced: about 2 months ago
JSON representation
easy tool to parse string to commands, easy tool to create commandlines
- Host: GitHub
- URL: https://github.com/programminglaboratorys/commandkit
- Owner: programminglaboratorys
- License: other
- Created: 2022-11-16T14:46:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-25T11:40:40.000Z (about 1 year ago)
- Last Synced: 2026-01-06T06:43:36.417Z (3 months ago)
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# commandkit
simple library to implement commands, events dispatchers
# installation
Run the following to install:
```cmd
pip install commandkit
```
### or
```cmd
python -m pip install commandkit
```
if that didn't work, try replacing `pip` with `pip3`.
need help? or have bugs to report, let me know in [here](https://discord.gg/vzEZnC7CM8)
## simple example
```python
from commandkit import CommandLine
cmder = CommandLine()
@cmder.command(name="foo")
def foo(cmd, num):
# do stuff with the cmd and num
...
@cmder.command(description="Calculate f(num) = num * 5")
def bar(num: int):
return num*5
cmder.process_command("foo kick 10")
print(cmder.process_command("bar 10")) # output: 50
```
# Documentation
you can check commandkit docs [here](https://commandkit.readthedocs.io/en/latest/)