cmdtools-py


Namecmdtools-py JSON
Version 3.0.4 PyPI version JSON
download
home_pagehttps://github.com/HugeBrain16/cmdtools
SummaryA (not quite) flexible command framework
upload_time2023-03-12 07:39:10
maintainerHugeBrain16
docs_urlNone
authorHugeBrain16
requires_python>=3.7,<4.0
licenseMIT
keywords command-parser command-processor command cmd cmd-parser framework command-framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div id="headline" align="center">
  <h1>cmdtools</h1>
  <p>A (not quite) flexible command framework.</p>
  <a href="https://github.com/HugeBrain16/cmdtools/actions/workflows/python-package.yml">
    <img src="https://github.com/HugeBrain16/cmdtools/actions/workflows/python-package.yml/badge.svg" alt="tests"></img>
  </a>
  <a href="https://pypi.org/project/cmdtools-py">
    <img src="https://img.shields.io/pypi/dm/cmdtools-py" alt="downloads"></img>
    <img src="https://badge.fury.io/py/cmdtools-py.svg" alt="PyPI version"></img>
    <img src="https://img.shields.io/pypi/pyversions/cmdtools-py" alt="Python version"></img>
  </a>
  <a href="https://codecov.io/gh/HugeBrain16/cmdtools">
    <img src="https://codecov.io/gh/HugeBrain16/cmdtools/branch/main/graph/badge.svg?token=mynvRn223H"/>
  </a>
  <a href='https://cmdtools-py.readthedocs.io/en/latest/?badge=latest'>
    <img src='https://readthedocs.org/projects/cmdtools-py/badge/?version=latest' alt='Documentation Status' />
  </a>
</div>

## Installation

```
pip install --upgrade cmdtools-py
```
install latest commit from GitHub  
```
pip install git+https://github.com/HugeBrain16/cmdtools.git
```

### Basic example

```py
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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/HugeBrain16/cmdtools",
    "name": "cmdtools-py",
    "maintainer": "HugeBrain16",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "joshtuck373@gmail.com",
    "keywords": "command-parser,command-processor,command,cmd,cmd-parser,framework,command-framework",
    "author": "HugeBrain16",
    "author_email": "joshtuck373@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/20/c1/2e68e4012ea39a402d137d26e509c89b865008256dc085245bb0afc45d51/cmdtools_py-3.0.4.tar.gz",
    "platform": null,
    "description": "<div id=\"headline\" align=\"center\">\n  <h1>cmdtools</h1>\n  <p>A (not quite) flexible command framework.</p>\n  <a href=\"https://github.com/HugeBrain16/cmdtools/actions/workflows/python-package.yml\">\n    <img src=\"https://github.com/HugeBrain16/cmdtools/actions/workflows/python-package.yml/badge.svg\" alt=\"tests\"></img>\n  </a>\n  <a href=\"https://pypi.org/project/cmdtools-py\">\n    <img src=\"https://img.shields.io/pypi/dm/cmdtools-py\" alt=\"downloads\"></img>\n    <img src=\"https://badge.fury.io/py/cmdtools-py.svg\" alt=\"PyPI version\"></img>\n    <img src=\"https://img.shields.io/pypi/pyversions/cmdtools-py\" alt=\"Python version\"></img>\n  </a>\n  <a href=\"https://codecov.io/gh/HugeBrain16/cmdtools\">\n    <img src=\"https://codecov.io/gh/HugeBrain16/cmdtools/branch/main/graph/badge.svg?token=mynvRn223H\"/>\n  </a>\n  <a href='https://cmdtools-py.readthedocs.io/en/latest/?badge=latest'>\n    <img src='https://readthedocs.org/projects/cmdtools-py/badge/?version=latest' alt='Documentation Status' />\n  </a>\n</div>\n\n## Installation\n\n```\npip install --upgrade cmdtools-py\n```\ninstall latest commit from GitHub  \n```\npip install git+https://github.com/HugeBrain16/cmdtools.git\n```\n\n### Basic example\n\n```py\nimport asyncio\nimport cmdtools\n\n@cmdtools.callback.add_option(\"message\")\ndef send(ctx):\n    print(ctx.options.message)\n\n@send.error\ndef error_send(ctx):\n  if isinstance(ctx.error, cmdtools.NotEnoughArgumentError):\n    if ctx.error.option == \"message\":\n      print(\"Message is required!\")\n\ncmd = cmdtools.Cmd('/send hello')\nasyncio.run(cmdtools.execute(cmd, send))\n```\n\n## Links\n\nPyPI project: https://pypi.org/project/cmdtools-py  \nSource code: https://github.com/HugeBrain16/cmdtools  \nIssues tracker: https://github.com/HugeBrain16/cmdtools/issues  \nDocumentation: https://cmdtools-py.readthedocs.io/en/latest\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A (not quite) flexible command framework",
    "version": "3.0.4",
    "split_keywords": [
        "command-parser",
        "command-processor",
        "command",
        "cmd",
        "cmd-parser",
        "framework",
        "command-framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d5288b26ae4120ad677e3982d2b6c2a7c1e56689b8c8eb962e1325fd0d39b9b",
                "md5": "8ccbfa8451e646dc5668eeb52a8c7914",
                "sha256": "eacce3ae4eb2366e959720c3d4e860c536806f4c35293c049e50eab9306f75d2"
            },
            "downloads": -1,
            "filename": "cmdtools_py-3.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ccbfa8451e646dc5668eeb52a8c7914",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 13831,
            "upload_time": "2023-03-12T07:39:07",
            "upload_time_iso_8601": "2023-03-12T07:39:07.650951Z",
            "url": "https://files.pythonhosted.org/packages/3d/52/88b26ae4120ad677e3982d2b6c2a7c1e56689b8c8eb962e1325fd0d39b9b/cmdtools_py-3.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20c12e68e4012ea39a402d137d26e509c89b865008256dc085245bb0afc45d51",
                "md5": "fb6e8bd5dd915592b2a32c0957a5a32f",
                "sha256": "080ad3030e5a12443ee419767ac442d1d8398eba774459872a1caa3cfe54ddb2"
            },
            "downloads": -1,
            "filename": "cmdtools_py-3.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "fb6e8bd5dd915592b2a32c0957a5a32f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 10379,
            "upload_time": "2023-03-12T07:39:10",
            "upload_time_iso_8601": "2023-03-12T07:39:10.440682Z",
            "url": "https://files.pythonhosted.org/packages/20/c1/2e68e4012ea39a402d137d26e509c89b865008256dc085245bb0afc45d51/cmdtools_py-3.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-12 07:39:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "HugeBrain16",
    "github_project": "cmdtools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "cmdtools-py"
}
        
Elapsed time: 0.31106s