{ "info": { "author": "Wouter Bolsterlee", "author_email": "uws@xs4all.nl", "bugtrack_url": null, "classifiers": [], "description": "******\nAaargh\n******\n\n*Aaargh*: an astonishingly awesome application argument helper.\n\n*Aaargh* is a Python module that makes building friendly command line\napplications really easy. Applications built with *Aaargh* provide a single\nexecutable with a subcommand for each exposed Python function. Each subcommand\nmay have its own command line arguments. This is similar to the way version\ncontrol systems provide multiple commands using a single entry point. (Examples\ninclude ``bzr commit`` and ``git checkout``).\n\n*Aaargh* is named after one of the castles in the movie *Monty Python and the\nHoly Grail*. The acronym *Aaargh* stands for *an astonishingly awesome\napplication argument helper*, but omits a few letters to make it triple A.\n\n*Aaargh* is compatible with both Python 2.6+ and Python 3.\n\n\nRationale\n=========\n\nThe Python standard library contains the *optparse*, *getopt*, and *argparse*\nmodules, and out in the wild you will find many alternative command line\ninterface libraries stacked on top of these, such as *cliff*, *cement*,\n*opster*, *plac*, and many others. Some of these libraries separate the command\nline interface setup of your application from the actual code, some force yet\nanother argument parsing API upon you, some force you to hide your code in\nnon-obvious framework constructs, and some even add dependencies on other\nmodules.\n\nThis makes you scream *aaargh*. And, lo and behold, here it is!\n\n\nUsage\n=====\n\n*Aaargh* delegates almost all of its work to the `argparse` module, which does\na great job handling arguments and printing usage information. However,\n`argparse` is a bit verbose and cumbersome for many simple applications, so\n*Aaargh* lets application authors minimize boilerplate code by wrapping\ncommonly used `argparse` features in a few non-intrusive decorators. *Aaargh*\ndoes not hide the `argparse` API, since the decorators have *exactly the same\nAPI* as their `argparse` counterparts. This is a deliberate design decision,\nand this is what makes *Aaargh* different from its many alternatives.\n\nThe docstrings in the `aaargh.py` file contain all information you need to use\n*Aaargh*. Refer to the `argparse` documentation for information on specifying\narguments, providing defaults, adding help texts, and so on.\n\n\nExample\n=======\n\nA simple command line application that exposes a few functions looks like\nthis::\n\n #!/usr/bin/env python\n\n import aaargh\n\n app = aaargh.App(description=\"A simple greeting application.\")\n\n # Application level arguments:\n app.arg('--name', help=\"Name of the person to greet\", default=\"stranger\")\n\n # Application level defaults:\n app.defaults(name=\"visitor\") # overrides \"stranger\"\n\n\n @app.cmd\n def hello(name): # application level \"name\" argument is always passed\n print(\"Hello, world!\")\n\n\n @app.cmd(name=\"hi\", help=\"Say hi\") # override subcommand name\n @app.cmd_arg('-r', '--repeat', type=int, default=1, help=\"How many times?\")\n def say_hi(name, repeat): # both application and subcommand args\n for i in range(repeat):\n print(\"Hi, %s!\" % name)\n\n\n @app.cmd\n @app.cmd_defaults(name=\"my friend\") # overrides \"visitor\" for this command only\n def greetings(name):\n print(\"Greetings, %s.\" % name)\n\n\n @app.cmd(alias='bye') # Allow \"bye\" aswell as goodbye\n def goodbye(name):\n print(\"Goodbye, cruel world!\")\n\n\n if __name__ == '__main__':\n app.run()\n\nThe command line interface for this application behaves like this::\n\n $ ./example.py hello\n Hello, world!\n\n $ ./example.py hi --repeat=3\n Hi, visitor!\n Hi, visitor!\n Hi, visitor!\n\n $ ./example.py --help\n usage: example.py [-h] [--name NAME] {hello,hi,greetings} ...\n\n A simple greeting application.\n\n optional arguments:\n -h, --help show this help message and exit\n --name NAME Name of the person to greet\n\n Subcommands:\n {hello,hi,greetings}\n hello\n hi Say hi\n greetings\n\n $ ./example.py hi --help\n usage: example.py hi [-h] [-r REPEAT]\n\n optional arguments:\n -h, --help show this help message and exit\n -r REPEAT, --repeat REPEAT\n How many times?\n\n\nInstallation\n============\n\nInstallation using `pip` is trivial, especially when using `virtualenv`::\n\n (yourenv) $ pip install aaargh\n\nAfter succesful installation, this should work::\n\n (yourenv) $ python\n >>> import aaargh\n >>> help(aaargh)\n\n.. note:\n\n For Python 2.6 you also need to install the `argparse` module.\n\n\nHistory\n=======\n\nVersion 0.7.1 (2014-03-13)\n--------------------------\n\n* Include licensing file in source distribution (issue #9, issue #13)\n\nVersion 0.7 (2014-02-18)\n------------------------\n\n* Add basic support for command aliases packaging (issue #4, issue #10)\n\nVersion 0.6 (2014-02-16)\n------------------------\n\n* No longer use `pbr` for packaging (issue #12)\n* Add proper licensing file (issue #9)\n* Fix error message when calling the program without a subcommand under Python 3\n\nVersion 0.5 (2013-09-23)\n------------------------\n\n* No longer add global args to subcommands (issues #3 and #5)\n* Switch to `pbr` for packaging\n\nVersion 0.4 (2012-10-17)\n------------------------\n\n* Fix automatic `argparse` dependency installation when using `pip install` with\n Python 2.6.\n\nVersion 0.3 (2012-06-10)\n------------------------\n\n* Also accept global args after the subcommand\n\nVersion 0.2 (2012-05-17)\n------------------------\n\n* Add support for Python 3\n\nVersion 0.1 (2012-05-17)\n------------------------\n\n* Initial release\n\n\n.. image:: https://d2weczhvl823v0.cloudfront.net/wbolster/aaargh/trend.png\n :alt: Bitdeli badge\n :target: https://bitdeli.com/free", "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/wbolster/aaargh", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "aaargh", "package_url": "https://pypi.org/project/aaargh/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/aaargh/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wbolster/aaargh" }, "release_url": "https://pypi.org/project/aaargh/0.7.1/", "requires_dist": null, "requires_python": null, "summary": "An astonishingly awesome application argument helper", "version": "0.7.1" }, "last_serial": 1028907, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2db1cf3c296633ab87ccb5f9721b8082", "sha256": "50e524781b9f731635ca681007a5767c86efc9e550e9f26860111224311058a9" }, "downloads": -1, "filename": "aaargh-0.1.tar.gz", "has_sig": false, "md5_digest": "2db1cf3c296633ab87ccb5f9721b8082", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4742, "upload_time": "2012-05-17T15:03:24", "url": "https://files.pythonhosted.org/packages/de/aa/0dafaab11f5fdc0bf1c4d8dbb14d6c3fc41f02fc92a2300a694fcd7213f4/aaargh-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "0d9f3f11b10358b187f72139d5e2f2b2", "sha256": "c162cfc0620a76659539b7a27dee5297dc64a6576b7c183b41b4f8ecea9ce123" }, "downloads": -1, "filename": "aaargh-0.2.tar.gz", "has_sig": false, "md5_digest": "0d9f3f11b10358b187f72139d5e2f2b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4905, "upload_time": "2012-05-17T17:28:37", "url": "https://files.pythonhosted.org/packages/7b/ea/d51726981f3dedf3f8bdba2f0326e789e9c55d38f11074cd97047ac0d62b/aaargh-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "993fb3a736fa1359d4c099471bb20d2c", "sha256": "d99a76b3a41b4f356ab010fd5d0185539060773d67da30ab5bedf69b74705c04" }, "downloads": -1, "filename": "aaargh-0.3.tar.gz", "has_sig": false, "md5_digest": "993fb3a736fa1359d4c099471bb20d2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5058, "upload_time": "2012-06-10T22:14:54", "url": "https://files.pythonhosted.org/packages/fb/bd/946a8942c0117eea884360173e2951b8230da37bce7c4865152d3757e6c3/aaargh-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "1f0079d039dbd706b541b1aa0d419d1e", "sha256": "bf9943edd35c2ebdc5e3ef384bd928220c5e6cb454f4f2e1139427e45cb0b586" }, "downloads": -1, "filename": "aaargh-0.4.tar.gz", "has_sig": false, "md5_digest": "1f0079d039dbd706b541b1aa0d419d1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5197, "upload_time": "2012-10-17T20:41:38", "url": "https://files.pythonhosted.org/packages/ee/d3/e59ce387baa936f57d09a428cb6cdf6d19c0c9ea2321df332a0f63f20072/aaargh-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "98701f565da185974837251bae54f8ca", "sha256": "35029053e15caa836e438396a35e86bfa9a5dac67846f022cc9d492f3821c808" }, "downloads": -1, "filename": "aaargh-0.5.tar.gz", "has_sig": false, "md5_digest": "98701f565da185974837251bae54f8ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7193, "upload_time": "2013-09-23T18:08:48", "url": "https://files.pythonhosted.org/packages/df/b8/4a2fffa05cc9ba9d7d1f3ae66798af621240f0cd1fe726efe74d0b9891c7/aaargh-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "1df538dea4b081c577d1841f7130c985", "sha256": "591dce109918e225d93bab81a7717167953c549e865ce8a0e73bbdf2e4e7b568" }, "downloads": -1, "filename": "aaargh-0.6.tar.gz", "has_sig": false, "md5_digest": "1df538dea4b081c577d1841f7130c985", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5493, "upload_time": "2014-02-16T19:54:26", "url": "https://files.pythonhosted.org/packages/5b/ce/7b2e1e8c70be90710f0bd24da2d4cf419e95e9aee7edf5849764ad406533/aaargh-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "da9128a79d10308abb3c0d4c01269b06", "sha256": "3d1199ad1a3723302b16aebfa6d4008a0e6b1e11cb4e7ecbed8889aac7a72842" }, "downloads": -1, "filename": "aaargh-0.7.tar.gz", "has_sig": false, "md5_digest": "da9128a79d10308abb3c0d4c01269b06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5883, "upload_time": "2014-02-18T21:08:50", "url": "https://files.pythonhosted.org/packages/e4/f7/ddc437b165fad5d8ab22ba69ceedb85dc9108a1097e564b1f57762ee5d19/aaargh-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "b9c3b0d47c78c05e72767784fd54f3b9", "sha256": "b3048896616553a6c6a24fd403eb10ce07d0af283b507872fefa53aefeea1d98" }, "downloads": -1, "filename": "aaargh-0.7.1.tar.gz", "has_sig": false, "md5_digest": "b9c3b0d47c78c05e72767784fd54f3b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6972, "upload_time": "2014-03-13T22:15:49", "url": "https://files.pythonhosted.org/packages/96/84/357793da71eba670c850e572d772ea8c8b889247377fb24238bc1f95edf8/aaargh-0.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b9c3b0d47c78c05e72767784fd54f3b9", "sha256": "b3048896616553a6c6a24fd403eb10ce07d0af283b507872fefa53aefeea1d98" }, "downloads": -1, "filename": "aaargh-0.7.1.tar.gz", "has_sig": false, "md5_digest": "b9c3b0d47c78c05e72767784fd54f3b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6972, "upload_time": "2014-03-13T22:15:49", "url": "https://files.pythonhosted.org/packages/96/84/357793da71eba670c850e572d772ea8c8b889247377fb24238bc1f95edf8/aaargh-0.7.1.tar.gz" } ] }