{ "info": { "author": "Adam Hopkins", "author_email": "admhpkns@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "asynccli\n========\n\n.. image:: https://img.shields.io/pypi/v/asynccli.svg\n :target: https://pypi.python.org/pypi/asynccli\n :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/status/asynccli.svg\n :target: https://pypi.python.org/pypi/asynccli\n :alt: Version status\n\n.. image:: https://img.shields.io/pypi/pyversions/asynccli.svg\n :target: https://pypi.python.org/pypi/asynccli\n :alt: Python 3.5 and 3.6\n\n.. image:: https://travis-ci.org/ahopkins/asynccli.svg?branch=master\n :target: https://travis-ci.org/ahopkins/asynccli\n :alt: Latest Travis CI build status\n\n.. image:: https://api.codacy.com/project/badge/Grade/b6f3abd70b6a4ead91c4b0bb820e1ddd\n :target: https://www.codacy.com/app/ahopkins/asynccli?utm_source=github.com&utm_medium=referral&utm_content=ahopkins/asynccli&utm_campaign=Badge_Grade\n :alt: Codacy grade\n\n.. image:: https://api.codacy.com/project/badge/Coverage/b6f3abd70b6a4ead91c4b0bb820e1ddd\n :target: https://www.codacy.com/app/ahopkins/asynccli?utm_source=github.com&utm_medium=referral&utm_content=ahopkins/asynccli&utm_campaign=Badge_Coverage\n :alt: Codacy coverage\n\nA CLI framework based on asyncio.\n\n.. note:: This is still in **active** development. Things will change. For now, the basic framework is operational. If you are interested in helping out, or would like to see any particular features added, let me know.\n\nUsage\n-----\n\nThe simplest usage is to just pass in an ``async`` function.\n\n.. code:: python\n\n import asynccli\n\n\n async def mycli():\n print(\"Hello, world.\")\n\n\n if __name__ == '__main__':\n app = asynccli.App(mycli)\n app.run()\n\n\nIt can also be instantiated as a class, as long it has a ``call`` method.\n\n.. code:: python\n\n import asynccli\n\n\n class DivisionCalculator(asynccli.CLI):\n numerator = asynccli.Integer(help_text='This is the numerator.')\n denominator = asynccli.Integer()\n\n async def call(self):\n print(self.first_num / self.second_num)\n\n\n if __name__ == '__main__':\n app = asynccli.App(DivisionCalculator)\n app.run()\n\nIn the ``DivisionCalculator`` example above, you would call your script like this:\n\n.. code::\n\n $ /path/to/script.py 2 3\n 0.6666666666666666\n\nWhat if you want to have a tiered CLI with a hierarchy of commands? First, create your command by subclassing ``CLI`` as above. Then, wrap the whole thing inside of the ``TieredCLI`` class, and pass that to the ``App``.\n\n.. code:: python\n\n class Calculator(asynccli.TieredCLI):\n d = DivisionCalculator\n\nNow, to invoke the script, you have an extra argument to call:\n\n.. code::\n\n $ /path/to/script.py d 2 3\n 0.6666666666666666\n\nInstallation\n------------\n\n.. code::\n\n pip install asynccli\n\nRequirements\n------------\n\nCurrently it requires Python 3.5 to make use of ``async``/``await``. It uses ``argparse`` under the hood, and therefore has **no dependencies** outside of the standard library.\n\nRoadmap\n-------\n\n- Additional ``Argument`` types\n- Integration of additional ``argparse`` features\n- Add ``uvloop``\n- Better support for help documentation\n\nTesting\n-------\n\nYou can invoke the test scripts a few different ways:\n\n.. code::\n\n $ py.test\n $ python setup.py test\n $ python -m py.test\n\nAnd, in order to generate the test coverage:\n\n.. code::\n\n $ coverage run -m py.test\n\nLicense\n-------\n\n`MIT `_\n\nAuthors\n-------\n\n``asynccli`` was written by `Adam Hopkins `_.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ahopkins/asynccli", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "asynccli", "package_url": "https://pypi.org/project/asynccli/", "platform": "", "project_url": "https://pypi.org/project/asynccli/", "project_urls": { "Homepage": "https://github.com/ahopkins/asynccli" }, "release_url": "https://pypi.org/project/asynccli/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "A CLI framework based on asyncio", "version": "0.1.3" }, "last_serial": 3132732, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0874dedf606629efa9822f0339a30721", "sha256": "f79538069d16ba858379c1f019638f64154c49d831fbbf189d35c09c14b74400" }, "downloads": -1, "filename": "asynccli-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0874dedf606629efa9822f0339a30721", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3015, "upload_time": "2017-08-27T11:49:10", "url": "https://files.pythonhosted.org/packages/6b/1f/f5d3d3baceef766c451c28d45db08ca3a39a6e9d0b6609633d3da8dba7ad/asynccli-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "be8cd4717e4841a99e341160e7f2e5cd", "sha256": "307531c0b435fe3d2d2bed16ea4e4f4065e8f329e175c69687b1005728b75e20" }, "downloads": -1, "filename": "asynccli-0.1.1.tar.gz", "has_sig": false, "md5_digest": "be8cd4717e4841a99e341160e7f2e5cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4362, "upload_time": "2017-08-29T08:10:14", "url": "https://files.pythonhosted.org/packages/48/80/07fb57ba54786f8ae1b83c8254e9054ddc2fb4593a74ebd5007fe6e4e622/asynccli-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "719781918f36118339c57aaaf8cf8311", "sha256": "65a1cb9208a698aad5ca2bda98cac2c0a920e681b06c8065c0cf77a63ddd5050" }, "downloads": -1, "filename": "asynccli-0.1.2.tar.gz", "has_sig": false, "md5_digest": "719781918f36118339c57aaaf8cf8311", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4349, "upload_time": "2017-08-29T08:10:40", "url": "https://files.pythonhosted.org/packages/fd/13/78d3f59abf5e4a422b17b3cd534457e72a3449d5f2a3e313d3e1da457ad4/asynccli-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c8fdce172beb05474d7ef22fb0e1dcd6", "sha256": "c3603f80856d8982817f0f2fcbe0429975242078e1bbae3e96cd4917f20c4c2a" }, "downloads": -1, "filename": "asynccli-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c8fdce172beb05474d7ef22fb0e1dcd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4497, "upload_time": "2017-08-29T18:07:49", "url": "https://files.pythonhosted.org/packages/57/f8/c4a2cef122af5a6eafc6d468346e1625b07713ea7ee8ab90caa27d47bc96/asynccli-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8fdce172beb05474d7ef22fb0e1dcd6", "sha256": "c3603f80856d8982817f0f2fcbe0429975242078e1bbae3e96cd4917f20c4c2a" }, "downloads": -1, "filename": "asynccli-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c8fdce172beb05474d7ef22fb0e1dcd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4497, "upload_time": "2017-08-29T18:07:49", "url": "https://files.pythonhosted.org/packages/57/f8/c4a2cef122af5a6eafc6d468346e1625b07713ea7ee8ab90caa27d47bc96/asynccli-0.1.3.tar.gz" } ] }