{ "info": { "author": "Douwe Osinga", "author_email": "douwe.osinga@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# Argument Clinic\n\n> Ah. I'd like to have an argument, please.\n\nThe standard way of writing a command line tool in Python is rather\nrepetitive. You construct an `ArgumentParser` object with a doc\nstring add documented parameters with their type, call parse on\nit and then call your `main(...)` with exactly the same parameters\nand if you are a good citizen, you document the call stuff again.\n\n```python\n\ndef main(input_file : str, *, scale : float = 125, fps : int = 30):\n \"\"\"Create a movie based that has droste aspects.\"\"\"\n pass\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser('Create a movie based that has droste aspects.')\n parser.add_argument('input_file', type=str)\n parser.add_argument('--scale', type=float, default=125)\n parser.add_argument('--fps', type=float, default=30)\n\n args = parser.parse_args()\n\n main(args.input, scale=args.scale, fps=args.fps)\n\n``` \n\nWith argument-clinic you can do the same with just:\n\n```python\n\n@argument.entrypoint\ndef main(input_file : str, *, scale : float = 125, fps : int = 30):\n \"\"\"Create a movie based that has droste aspects.\"\"\"\n pass\n\nif __name__ == '__main__':\n main()\n\n``` \n\n## Installation\n\n`pip install argument-clinic`\n\n## More details\n\nAs shown above, the basic usage is to use the `@argument.entrypoint`\nfor your main and have all command line arguments to your script be \narguments of your `main(..)` entry point. When you call `main` the values\nfor each argument will be supplied automatically.\n\nSeparate positional arguments and keyword arguments in your\nmain with a `*` (which is good practice anyway). Anything after\nthe star becomes a flag that requires a value.\n\nThe doc string of your `main` will automatically become the help\nfor your script. If you document the parameters to your `main` in your\ndoc string, these comments will be added to the right parameters (any type\nspecification will be ignored though)\n\nThe best thing: it doesn't cost you 5 pounds for 5 more minutes.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DOsinga/argument-clinic", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "argument-clinic", "package_url": "https://pypi.org/project/argument-clinic/", "platform": "", "project_url": "https://pypi.org/project/argument-clinic/", "project_urls": { "Homepage": "https://github.com/DOsinga/argument-clinic" }, "release_url": "https://pypi.org/project/argument-clinic/0.12/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Argument clinic makes creates a command line interface out of your main() so you don't have to.", "version": "0.12" }, "last_serial": 5408113, "releases": { "0.11": [ { "comment_text": "", "digests": { "md5": "1c5e7791c224cd0bd708c51c080fb15a", "sha256": "fe3e606162c3a4aff372f6f1c2dd84f74b82c8616088409a61b87c642a40ea7a" }, "downloads": -1, "filename": "argument-clinic-0.11.tar.gz", "has_sig": false, "md5_digest": "1c5e7791c224cd0bd708c51c080fb15a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3860, "upload_time": "2019-06-17T01:31:38", "url": "https://files.pythonhosted.org/packages/8e/3e/8f65fec72d2621b5a02b1f206d46cd2e7d7e622a7a32119e1541a1714e0a/argument-clinic-0.11.tar.gz" } ], "0.12": [ { "comment_text": "", "digests": { "md5": "037eba3c6f4d7912597836bb16bd3184", "sha256": "b60d2c82f505f1856b3566cdca760b5958d254291f6f381f57ab01cf93d800d6" }, "downloads": -1, "filename": "argument-clinic-0.12.tar.gz", "has_sig": false, "md5_digest": "037eba3c6f4d7912597836bb16bd3184", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3856, "upload_time": "2019-06-17T01:42:12", "url": "https://files.pythonhosted.org/packages/75/6b/4a8b8318fdad8415d8411e7c1abaa94041eb210115caa2a7cf04e898d4fb/argument-clinic-0.12.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "037eba3c6f4d7912597836bb16bd3184", "sha256": "b60d2c82f505f1856b3566cdca760b5958d254291f6f381f57ab01cf93d800d6" }, "downloads": -1, "filename": "argument-clinic-0.12.tar.gz", "has_sig": false, "md5_digest": "037eba3c6f4d7912597836bb16bd3184", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3856, "upload_time": "2019-06-17T01:42:12", "url": "https://files.pythonhosted.org/packages/75/6b/4a8b8318fdad8415d8411e7c1abaa94041eb210115caa2a7cf04e898d4fb/argument-clinic-0.12.tar.gz" } ] }