{ "info": { "author": "Michael Milton", "author_email": "michael.r.milton@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: User Interfaces" ], "description": "# ArgparsePrompt\nArgparsePrompt is a wrapper for the built-in Argparse, allowing missing command-line arguments to be filled in by the\nuser via interactive prompts\n\n# Installation\nArgparsePrompt can be installed using pip:\n```bash\npip install argparse_prompt\n```\n\n# Usage\n\n## Basic Usage\nThe only public interface of this module is the `PromptParser` class, which is a subclass of Python's \n[ArgumentParser](https://docs.python.org/3/library/argparse.html). Use this class in exactly the same way that you would\nuse ArgumentParser, except that, if any argument does not have a specified `default` value, and a value is not provided\nfor it on the commandline, the `PromptParser` will prompt for a value for this argument using `input()`, which is read \nfrom stdin.\n\nConsider the code below (taken from one of the unit tests):\n\n```python\nfrom argparse_prompt import PromptParser\n\nparser = PromptParser()\nparser.add_argument('--argument', '-a', help='An argument you could provide', default='foo')\nprint(parser.parse_args().argument)\n```\n\nIf you run this script with a value for `argument`, the parsing will run as normal:\n```\n$ python test/default_parser.py --argument 12\n12\n```\n\nHowever if you don't specify a value for `arg`, the parser will prompt you for one\n```\n$ python test/default_parser.py\nargument: An argument you could provide\n> (foo) car\ncar\n```\n\n## Default Values\nSince this argument has a default value, you can also just hit enter and this value will be used automatically:\n```\npython test/default_parser.py\nargument: An argument you could provide\n> (foo) \nfoo\n```\n\n## Type Checking\nYou can also specify a type for the argument in the normal way:\n\n```python\nfrom argparse_prompt import PromptParser\n\nparser = PromptParser()\nparser.add_argument('--argument', '-a', help='An argument you could provide', type=int)\nprint(parser.parse_args().argument)\n```\n\nIf you do, this type checking will be used for the value you enter at the prompt:\n```\n$ python test/typed_parser.py \nargument: An argument you could provide\nabc\nArgument \"argument\" was given a value not of type \n```\n\n## Secure Values\nFor arguments that need to be secure, such as passwords, secret keys etc, you can use `secure=True` when defining your\nargument. This will cause whatever the user inputs for that field to be hidden from the terminal, in the same way that \n`git`, or `ssh` hides the password input.\n\nFor example:\n```python\nparser.add_argument('--password', '-p', help='A very secret password', secure=True)\n```\n\n\n## Situationally Disabling the Prompt\nIf you use the `prompt` argument to `add_argument`, parsing will be disabled:\n\n```python\nparser.add_argument('--argument', '-a', help='An argument you could provide', default='foo', prompt=False)\n```\n\nAlso, if you want to disable all prompting (for an automated script, for example), just set the `ARGPARSE_PROMPT_AUTO` to\na truthy value:\n```bash\nARGPARSE_PROMPT_AUTO=1 python test/default_parser.py\n```\n\n\n", "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/MelbourneGenomics/ArgparsePrompt", "keywords": "argparse prompt interactive argument", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "argparse-prompt", "package_url": "https://pypi.org/project/argparse-prompt/", "platform": "", "project_url": "https://pypi.org/project/argparse-prompt/", "project_urls": { "Homepage": "https://github.com/MelbourneGenomics/ArgparsePrompt" }, "release_url": "https://pypi.org/project/argparse-prompt/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Wrapper for the built-in Argparse, allowing missing command-line arguments to be filled in by the user via interactive prompts", "version": "0.0.4" }, "last_serial": 4373795, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7f95a4ece7683ce1ac512992f1fecc5f", "sha256": "aa77ae177fa0366f72c7185044eb3c76f1165624e4a31c35f1e44ded961b5bbc" }, "downloads": -1, "filename": "argparse_prompt-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7f95a4ece7683ce1ac512992f1fecc5f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1700, "upload_time": "2017-05-25T06:36:57", "url": "https://files.pythonhosted.org/packages/fb/ec/9bcb1b0b30979002060e537f959dfae98dacddcc93a3a0861740c914ca8d/argparse_prompt-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4175a20d109faea19b4294d43c958acd", "sha256": "46a92fd40d5d00064883a15b173bdb88c2d5a7beb08bf76dbd2214d91637adbe" }, "downloads": -1, "filename": "argparse_prompt-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4175a20d109faea19b4294d43c958acd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 650, "upload_time": "2017-05-25T06:36:59", "url": "https://files.pythonhosted.org/packages/b4/5d/f3d59da2e689a90843e82836cb5d02a756f152e2343bb9cb59f42b322d29/argparse_prompt-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ef67203ad971ad55db50c5132a63ac36", "sha256": "2bc062b164e4e25541d409ea38720093853832f26d1d40201906cfc49736b0ec" }, "downloads": -1, "filename": "argparse_prompt-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ef67203ad971ad55db50c5132a63ac36", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5272, "upload_time": "2017-05-25T07:01:08", "url": "https://files.pythonhosted.org/packages/a7/d9/11fecc06f9cc80050ab73bcfb8f9a94a8e6b035daa24c6921b6dca7cd710/argparse_prompt-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ab1e6b5a78cfa51a66ba22dffdf70f77", "sha256": "a933e591ba0b2378bfe44a831c2f69b4193a3ab5054fef70c5798d20bed50e8f" }, "downloads": -1, "filename": "argparse_prompt-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ab1e6b5a78cfa51a66ba22dffdf70f77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2942, "upload_time": "2017-05-25T07:01:09", "url": "https://files.pythonhosted.org/packages/c8/0a/b704379340d0229707238ba32da50759c40432d92e0c1b832bbc407e3dab/argparse_prompt-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "10b0758eabe6d463e901bb5bd67cf367", "sha256": "44d70a22c2b8223439d5f60152590cd3a72844c684b35f5a9dd7b29f6c72c321" }, "downloads": -1, "filename": "argparse_prompt-0.0.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "10b0758eabe6d463e901bb5bd67cf367", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4301, "upload_time": "2018-10-14T08:49:40", "url": "https://files.pythonhosted.org/packages/2d/84/cdd025d04a1831f6cfb76a9822fde00560161526b8a021458747e63e0efe/argparse_prompt-0.0.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "fe878bfff801471251ab957f52d561e0", "sha256": "271ad0cc4aa5a01e0820b7fa89584501d03a7c927b2e834699328fbc67d9590d" }, "downloads": -1, "filename": "argparse_prompt-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fe878bfff801471251ab957f52d561e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15921, "upload_time": "2018-10-14T08:49:38", "url": "https://files.pythonhosted.org/packages/7e/5e/38737fd8d696a01877ef950b7067abd7319952c048230639cdaeb53cff24/argparse_prompt-0.0.3-py3-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "13fb8d0d2bb11c4a5a0b32d3ac3e8bce", "sha256": "3afa1dd5704d7a579e0729cdb9fb31abf4b40b40d52d622ba6a20a52e25a85da" }, "downloads": -1, "filename": "argparse_prompt-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "13fb8d0d2bb11c4a5a0b32d3ac3e8bce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16084, "upload_time": "2018-10-14T08:57:18", "url": "https://files.pythonhosted.org/packages/bf/5d/7a3bc97f5b0533b371fa11d56cd6034f04f60ea91c21bd2b8878ff228db1/argparse_prompt-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7d83b35ef30a832dbe9f40596b8de9a", "sha256": "1790ac301e469d0929d38b28d8187cab52be219580cf18dadcf36e2efea7ee47" }, "downloads": -1, "filename": "argparse_prompt-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d7d83b35ef30a832dbe9f40596b8de9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3618, "upload_time": "2018-10-14T08:57:19", "url": "https://files.pythonhosted.org/packages/37/15/912789b79310d36d1d9ca624aac608467c65b93b99d08f4b79e85dcccd60/argparse_prompt-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "13fb8d0d2bb11c4a5a0b32d3ac3e8bce", "sha256": "3afa1dd5704d7a579e0729cdb9fb31abf4b40b40d52d622ba6a20a52e25a85da" }, "downloads": -1, "filename": "argparse_prompt-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "13fb8d0d2bb11c4a5a0b32d3ac3e8bce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16084, "upload_time": "2018-10-14T08:57:18", "url": "https://files.pythonhosted.org/packages/bf/5d/7a3bc97f5b0533b371fa11d56cd6034f04f60ea91c21bd2b8878ff228db1/argparse_prompt-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7d83b35ef30a832dbe9f40596b8de9a", "sha256": "1790ac301e469d0929d38b28d8187cab52be219580cf18dadcf36e2efea7ee47" }, "downloads": -1, "filename": "argparse_prompt-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d7d83b35ef30a832dbe9f40596b8de9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3618, "upload_time": "2018-10-14T08:57:19", "url": "https://files.pythonhosted.org/packages/37/15/912789b79310d36d1d9ca624aac608467c65b93b99d08f4b79e85dcccd60/argparse_prompt-0.0.4.tar.gz" } ] }