Skip to main content

A (not quite) flexible command framework

Project description

cmdtools

A (not quite) flexible command framework.

tests downloads PyPI version Python version Documentation Status

Installation

pip install --upgrade cmdtools-py

install the 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
Repository: https://github.com/HugeBrain16/cmdtools
Issues tracker: https://github.com/HugeBrain16/cmdtools/issues
Documentation: https://cmdtools-py.readthedocs.io/en/latest

Project details


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.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmdtools_py-3.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file cmdtools_py-3.1.0.tar.gz.

File metadata

  • Download URL: cmdtools_py-3.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for cmdtools_py-3.1.0.tar.gz
Algorithm Hash digest
SHA256 e9c302b5b664661e8a0ecfc05ef63b75fba00ae9c20fe3a0eb202f3d3109d799
MD5 a0b18e7ed70d8307394f672a741d70af
BLAKE2b-256 d5eb211bd481df6303f6a582499716b9693a83e98788ce7cadb1aee70bc6605a

See more details on using hashes here.

File details

Details for the file cmdtools_py-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: cmdtools_py-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for cmdtools_py-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a96a497e453f36eebe4224de1192fd504d06613f0092efbe874e42c8f4a7ec
MD5 ca6f50bf6642b7ae9d2523abd844bb09
BLAKE2b-256 8652774b6af08f881da881fa9557edca5747e971d75e901d1afd63646b3d81de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page