{ "info": { "author": "JBC", "author_email": "jbc dot develop at gmail dot com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Topic :: Utilities" ], "description": "Abstraction layer over argparse.\n\nCaipyrinha added 2 methods to argparse.ArgumentParser, ``callback`` and\n``parse_wc``. Also a Caipyrinha instance is callable and is equal to use\n``parse_wc`` method.\n\n\nExample of use:\n\n.. code-block:: python\n\n # ex.py\n\n import caipyrinha\n\n parser = caipyrinha.Caipyrinha(prog=\"Your Program\")\n parser.add_argument(\"--version\", action='version', version=\"%(prog)s 0.1\")\n\n @parser.callback(exit=0, exclusive=\"group1\")\n def first(flags, returns):\n '''Execute this option and exit'''\n print \"bye bye\"\n\n @parser.callback(action=\"store\")\n def second(flags, returns):\n '''set his own return value with his parameter'''\n return flags.second\n\n @parser.callback(\"--third\", exclusive=\"group1\")\n def no_used_name(flags, returns):\n '''you cant use this argument with first'''\n print returns.second\n\n import sys\n parser(sys.argv[1:])\n\n\n**Usage**\n\n::\n\n $ python ex.py --help\n usage: Your Program [-h] [--version] [--first] [--second SECOND] [--third]\n\n optional arguments:\n -h, --help show this help message and exit\n --version show program's version number and exit\n --first Execute this option and exit\n --second SECOND set his own return value with his parameter\n --third you cant use this argument with first\n $ python ex.py --first\n bye bye\n $ python ex.py --first --second \"hello from second\"\n bye bye\n $ python ex.py --first --second \"hello from second\" --third\n usage: Your Program [-h] [--version] [--first] [--second SECOND] [--third]\n Your Program: error: argument --third: not allowed with argument --first\n $ python ex.py --second \"hello from second\" --third\n hello from second", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/leliel12/caipyrinha/downloads/0.2.2-caipyrinha.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/leliel12/caipyrinha", "keywords": "cli argparse argument parser optparse getopt", "license": "WISKEY License", "maintainer": null, "maintainer_email": null, "name": "caipyrinha", "package_url": "https://pypi.org/project/caipyrinha/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/caipyrinha/", "project_urls": { "Download": "https://bitbucket.org/leliel12/caipyrinha/downloads/0.2.2-caipyrinha.tar.gz", "Homepage": "https://bitbucket.org/leliel12/caipyrinha" }, "release_url": "https://pypi.org/project/caipyrinha/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Abstraction layer over argparse.", "version": "0.2.2" }, "last_serial": 878616, "releases": { "0.1": [], "0.2": [], "0.2.1": [], "0.2.2": [ { "comment_text": "", "digests": { "md5": "35b68f5a35ef1ffff4feed5bcd1989e6", "sha256": "ad311aea0f953719882ca42a86aa65d37ddbd6418daa21188435837fef079e04" }, "downloads": -1, "filename": "caipyrinha-0.2.2.tar.gz", "has_sig": false, "md5_digest": "35b68f5a35ef1ffff4feed5bcd1989e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7331, "upload_time": "2013-10-02T03:29:41", "url": "https://files.pythonhosted.org/packages/4f/2c/cbdeb205c3a6c100e5e475c18014506e379d73a0fdcea9490880eb80d14f/caipyrinha-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35b68f5a35ef1ffff4feed5bcd1989e6", "sha256": "ad311aea0f953719882ca42a86aa65d37ddbd6418daa21188435837fef079e04" }, "downloads": -1, "filename": "caipyrinha-0.2.2.tar.gz", "has_sig": false, "md5_digest": "35b68f5a35ef1ffff4feed5bcd1989e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7331, "upload_time": "2013-10-02T03:29:41", "url": "https://files.pythonhosted.org/packages/4f/2c/cbdeb205c3a6c100e5e475c18014506e379d73a0fdcea9490880eb80d14f/caipyrinha-0.2.2.tar.gz" } ] }