{ "info": { "author": "Lars Franke", "author_email": "lars.franke@mailbox.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "Clype\n=====\n\nPlaying around with the new type annotations in Python 3.5 and 3.6, I\nnoticed they can be used to define command line interfaces from a\nregular python function. It's kind of like what\n`click `__ does, but better.\n\nUsage\n-----\n\nSimpleCli Example:\n\n.. code:: python\n\n # test.py\n from typing import List, Optional\n from pathlib import Path\n from clype import SimpleCli\n\n @SimpleCli\n def mycli(v: Optional[bool], paths: List[Path]):\n print('v:', v)\n print('paths ({}):'.format(type(paths[0])), *paths)\n\n if __name__ == '__main__':\n mycli.run()\n\nResult:\n\n::\n\n $ python test.py -v dir/file.ext\n v: True\n paths (): dir/file.ext\n\nSubcommandCli Example:\n\n.. code:: python\n\n # test.py\n from typing import List, Optional\n from pathlib import Path\n from clype import SubcommandCli\n\n mycli = SubcommandCli('mycli')\n\n @mycli.command\n def bar(r: Optional[bool], path: Path):\n \"\"\"\n The first command\n \"\"\"\n pass\n\n @mycli.command\n def foo(v: Optional[bool], paths: List[Path]):\n \"\"\"\n The second command\n \"\"\"\n pass\n\n if __name__ == '__main__':\n mycli.run()\n\nResult:\n\n::\n\n $ python test.py -h\n usage: mycli [-h] command ...\n optional arguments:\n -h, --help show this help message and exit\n commands:\n bar The first command\n foo The second command\n $ python test.py bar -h\n usage: mycli bar [-h] [-r] path\n positional arguments:\n path\n optional arguments:\n -h, --help show this help message and exit\n -r", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/frcl/clype", "keywords": "cli console typehints annotations", "license": "LGPLv3", "maintainer": null, "maintainer_email": null, "name": "clype", "package_url": "https://pypi.org/project/clype/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/clype/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/frcl/clype" }, "release_url": "https://pypi.org/project/clype/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Python library for creating command line interfacesusing type annotations", "version": "0.1.0" }, "last_serial": 2928521, "releases": { "0.1.0": [] }, "urls": [] }