{ "info": { "author": "Wildfish", "author_email": "developers@wildfish.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "argparsetree\n============\n\nPackage for creating complex command line argument trees using argparse.\n\nBasic Usage\n-----------\n\nYou can create a single command by creating a class extending ``argparsetree.BaseCommand``\nand overriding the ``add_arguments`` and ``action_methods``. For example::\n\n from argparsetree import BaseCommand\n\n\n class MyCommand(BaseCommand):\n def add_arguments(parser):\n parser.add_arguments('foo', help='Some description of \"foo\"')\n\n def action(args):\n print(args.foo)\n\nThe ``parser`` argument passed to ``add_arguments`` is an ``argparse.ArgumentParser`` object. Similarly\nthe ``args`` parameter passed to the ``action`` method is a ``argparse.Namespace`` object generated by\ncalling ``parse_args`` on the generated argument parser.\n\nAdditionally the description property can be set on the command class, this will be used when building\nthe help message.\n\nIf a return value other than ``None`` is returned from ``action`` this will be used as the return code from the\n``run`` function. If no value is returned (or the value is ``None``) the value is assumed to be 0.\n\nOnce you have created your command you can use it by creating a script similar to::\n\n #!/usr/bin/env python\n import sys\n\n from mycli import MyCommand\n\n\n if __name__ == '__main__':\n sys.exit(MyCommand().run())\n\nNested Usage\n------------\n\nChild commands can also be added to a command by specifying the ``sub_commands`` property. This is a dictionary\nthat maps command names to command classes. For example::\n\n #!/usr/bin/env python\n\n import sys\n from argparsetree import BaseCommand\n\n\n class CleanFooCommand(BaseCommand):\n description = 'Cleans up the foo object'\n\n def add_args(self, parser):\n parser.add_argument('target', help='The foo file to clean up')\n parser.add_argument('-y', '--yes', help='Automatic answer yes to prompts', action='store_true')\n\n def action(self, args):\n # do cleaning\n return 0\n\n\n class CheckFooCommand(BaseCommand):\n description = 'Checks the integrity of a foo object'\n\n def add_args(self, parser):\n parser.add_argument('target', help='The foo file to clean up')\n parser.add_argument('-y', '--yes', help='Automatic answer yes to prompts', action='store_true')\n\n def action(self, args):\n # do cleaning\n return 0\n\n\n class FooCommand(BaseCommand):\n description = 'Do things with foos'\n sub_commands = {\n 'check': CheckFooCommand,\n 'clean': CleanFooCommand,\n # more sub commands here\n }\n\n\n class RootCommand(BaseCommand):\n description = 'My fancy CLI'\n sub_commands = {\n 'foo': FooCommand,\n # more sub commands here\n }\n\n\n if __name__ == '__main__':\n sys.exit(RootCommand().run())\n\nRunning ``./example.py`` would give the following output::\n\n usage: My fancy CLI [-h] {foo} ...\n\n positional arguments:\n {foo}\n foo Do things with foos\n\n optional arguments:\n -h, --help show this help message and exit\n\nAnd running ``./example.py foo`` gives::\n\n usage: Do things with foos [-h] {check,clean} ...\n\n positional arguments:\n {check,clean}\n check Checks the integrity of a foo object\n clean Cleans up the foo object\n\n optional arguments:\n -h, --help show this help message and exit\n\nAn extended help message for each command (and sub-command) can be printed by adding the ``--help`` flag,\nSo running ``./example.py foo check --help`` gives::\n\n usage: My fancy CLI foo check [-h] [-y] target\n\n Checks the integrity of a foo object\n\n positional arguments:\n target The foo file to clean up\n\n optional arguments:\n -h, --help show this help message and exit\n -y, --yes Automatic answer yes to prompts\n\n\n\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/wildfish/argparsetree", "keywords": "class based argparse", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "argparsetree", "package_url": "https://pypi.org/project/argparsetree/", "platform": "", "project_url": "https://pypi.org/project/argparsetree/", "project_urls": { "Homepage": "https://github.com/wildfish/argparsetree" }, "release_url": "https://pypi.org/project/argparsetree/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Package for creating complex command line argument trees using argparse", "version": "0.0.6" }, "last_serial": 3666219, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "307c49a31972a0a06f495d93c03fc512", "sha256": "5d50e214ff6c1a4afd9867b4293f83fed16cf142b5bf7552738a5828f96c20af" }, "downloads": -1, "filename": "argparsetree-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "307c49a31972a0a06f495d93c03fc512", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7387, "upload_time": "2018-01-25T16:53:13", "url": "https://files.pythonhosted.org/packages/8e/dc/8c948063bc38014f2e3e162ee333d313c3326e5cf9fe26deea07bbc8bb04/argparsetree-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e69ef4208942def20ace4cd8acaed21f", "sha256": "0dbe86bba8256223d04a13a28f72636dfa772e0fa0d6ff9346e242a3328d2031" }, "downloads": -1, "filename": "argparsetree-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e69ef4208942def20ace4cd8acaed21f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5307, "upload_time": "2018-01-25T16:53:15", "url": "https://files.pythonhosted.org/packages/82/de/d98f5efa0912866f8136b1ad2cda3b083bca49b82337858856a841a4a303/argparsetree-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "af1af3fcb0320da6148a1b662de17b5e", "sha256": "87bfb01bf10cacc77723ba6177701ee2979cf51f38c7be0a1600504c65eae4a5" }, "downloads": -1, "filename": "argparsetree-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "af1af3fcb0320da6148a1b662de17b5e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7734, "upload_time": "2018-01-26T09:54:51", "url": "https://files.pythonhosted.org/packages/ae/fa/6e38d3f44b04cc98a4e6e0107ac6d9039b75c765335f904ce95552b5bb26/argparsetree-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa6c32b3a6ffc9514c47056c9ab07fd4", "sha256": "2df7677362d8dd31e45344c8a591835fdcdde68851030b87dd9b6403bae8535c" }, "downloads": -1, "filename": "argparsetree-0.0.2.tar.gz", "has_sig": false, "md5_digest": "aa6c32b3a6ffc9514c47056c9ab07fd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5697, "upload_time": "2018-01-26T09:54:53", "url": "https://files.pythonhosted.org/packages/64/52/9624e6f1def16a53bb6080f12ad7ec0398f3ca7b3b63dfcf39c8146d9578/argparsetree-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "abdb2b67e80a52f0479b7bb1294709a1", "sha256": "3aac65afcb9651ba04fcdab3b9bf828ab9ada186e2d3024ea32538ffc9aad228" }, "downloads": -1, "filename": "argparsetree-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "abdb2b67e80a52f0479b7bb1294709a1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7932, "upload_time": "2018-02-01T16:54:09", "url": "https://files.pythonhosted.org/packages/2a/7b/405b2d5fa27598e61f337b3600513f7a4cdbe971cb017882bd3a55b45d6e/argparsetree-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ff31c01ddcb711b0184cc7b3148b3e", "sha256": "f25e00f0e6f51f26144fbc6067ac5057d816259cde7633883f298f4fcd653f4e" }, "downloads": -1, "filename": "argparsetree-0.0.3.tar.gz", "has_sig": false, "md5_digest": "95ff31c01ddcb711b0184cc7b3148b3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5859, "upload_time": "2018-02-01T16:54:11", "url": "https://files.pythonhosted.org/packages/a3/90/b698448ef733bc4a298511a92d659668d1a1605780c739d5ef0c0363aae8/argparsetree-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "2be517e18ffae320e1e0dbc13a2a24ed", "sha256": "9d3a7891f7d774de1fbad528ebc6744eb41381785e0da766348961fe7a3b88ce" }, "downloads": -1, "filename": "argparsetree-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2be517e18ffae320e1e0dbc13a2a24ed", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7931, "upload_time": "2018-02-05T17:41:44", "url": "https://files.pythonhosted.org/packages/14/ae/a1b55dbb96ee8dbbe8b32a4c05a4e6af53af880ec54e939fa26d2f60c85e/argparsetree-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3abe6991862e99fd1c8390c7f32fa5f0", "sha256": "40d0cfc6290e8d7a6cc6a411c255ee70bebf76bc907738ffa209524a838a0db8" }, "downloads": -1, "filename": "argparsetree-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3abe6991862e99fd1c8390c7f32fa5f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5863, "upload_time": "2018-02-05T17:41:45", "url": "https://files.pythonhosted.org/packages/43/9e/3d89464e64a76a742a6188b0f9e166a50c352b8a126f28329c7a64fcbe35/argparsetree-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "5bc4051e9dc4dea39ff12a7041c78d96", "sha256": "76869f9579bba230c4b10128e149b33c0229edbc2f1d23ac1ed462b54db6e43d" }, "downloads": -1, "filename": "argparsetree-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5bc4051e9dc4dea39ff12a7041c78d96", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8099, "upload_time": "2018-02-06T13:07:17", "url": "https://files.pythonhosted.org/packages/17/fa/247635531f78cc4651a9145cd9891eb77f3db192c2c419d953a4dd473567/argparsetree-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a920fb7fe38cd9010ec1b614b76e598", "sha256": "814cd99e3f941f98af5b2bc7924ad104ebff8a3b06240d481c9857a7d7b67545" }, "downloads": -1, "filename": "argparsetree-0.0.5.tar.gz", "has_sig": false, "md5_digest": "7a920fb7fe38cd9010ec1b614b76e598", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6023, "upload_time": "2018-02-06T13:07:17", "url": "https://files.pythonhosted.org/packages/91/c7/0dc602a14bb5a6ce089ee0832544735c92c71ccbf83d1da17f5b72f947e1/argparsetree-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "ec1748f6001f8c1e6ffe7d8fe68bb417", "sha256": "aa59ddc1b88a85d940419927d83e82637d317258ece6f0526b4b619fb72741a6" }, "downloads": -1, "filename": "argparsetree-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec1748f6001f8c1e6ffe7d8fe68bb417", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6350, "upload_time": "2018-03-13T17:36:45", "url": "https://files.pythonhosted.org/packages/82/eb/fcfe7705f48b4ad7601a8a78260083cbb3f3be2e13e74a8753e10723a7fb/argparsetree-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba0a93c1a2013050cd44a29de1af7283", "sha256": "8ddec3a55c2ca7fe3a0a2dc771aadffca9296b3548c7038a4c8b9285366925fc" }, "downloads": -1, "filename": "argparsetree-0.0.6.tar.gz", "has_sig": false, "md5_digest": "ba0a93c1a2013050cd44a29de1af7283", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4681, "upload_time": "2018-03-13T17:36:46", "url": "https://files.pythonhosted.org/packages/65/f9/bc760526c45f6d3d796a130a6eb549b298b2f02f3ccb32fcbad39993a905/argparsetree-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ec1748f6001f8c1e6ffe7d8fe68bb417", "sha256": "aa59ddc1b88a85d940419927d83e82637d317258ece6f0526b4b619fb72741a6" }, "downloads": -1, "filename": "argparsetree-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec1748f6001f8c1e6ffe7d8fe68bb417", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6350, "upload_time": "2018-03-13T17:36:45", "url": "https://files.pythonhosted.org/packages/82/eb/fcfe7705f48b4ad7601a8a78260083cbb3f3be2e13e74a8753e10723a7fb/argparsetree-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba0a93c1a2013050cd44a29de1af7283", "sha256": "8ddec3a55c2ca7fe3a0a2dc771aadffca9296b3548c7038a4c8b9285366925fc" }, "downloads": -1, "filename": "argparsetree-0.0.6.tar.gz", "has_sig": false, "md5_digest": "ba0a93c1a2013050cd44a29de1af7283", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4681, "upload_time": "2018-03-13T17:36:46", "url": "https://files.pythonhosted.org/packages/65/f9/bc760526c45f6d3d796a130a6eb549b298b2f02f3ccb32fcbad39993a905/argparsetree-0.0.6.tar.gz" } ] }