Catalog PyPI
PACKAGE EXPLORERView in registry

aaargh

PyPI

An astonishingly awesome application argument helper

Versions collected1
Direct dependencies0From release 0.7.1
Last observed20 Oct, 16:47 UTC

README

Version 0.7.1 documentation
******
Aaargh
******

*Aaargh*: an astonishingly awesome application argument helper.

*Aaargh* is a Python module that makes building friendly command line
applications really easy. Applications built with *Aaargh* provide a single
executable with a subcommand for each exposed Python function. Each subcommand
may have its own command line arguments. This is similar to the way version
control systems provide multiple commands using a single entry point. (Examples
include ``bzr commit`` and ``git checkout``).

*Aaargh* is named after one of the castles in the movie *Monty Python and the
Holy Grail*. The acronym *Aaargh* stands for *an astonishingly awesome
application argument helper*, but omits a few letters to make it triple A.

*Aaargh* is compatible with both Python 2.6+ and Python 3.


Rationale
=========

The Python standard library contains the *optparse*, *getopt*, and *argparse*
modules, and out in the wild you will find many alternative command line
interface libraries stacked on top of these, such as *cliff*, *cement*,
*opster*, *plac*, and many others. Some of these libraries separate the command
line interface setup of your application from the actual code, some force yet
another argument parsing API upon you, some force you to hide your code in
non-obvious framework constructs, and some even add dependencies on other
modules.

This makes you scream *aaargh*. And, lo and behold, here it is!


Usage
=====

*Aaargh* delegates almost all of its work to the `argparse` module, which does
a great job handling arguments and printing usage information. However,
`argparse` is a bit verbose and cumbersome for many simple applications, so
*Aaargh* lets application authors minimize boilerplate code by wrapping
commonly used `argparse` features in a few non-intrusive decorators. *Aaargh*
does not hide the `argparse` API, since the decorators have *exactly the same
API* as their `argparse` counterparts. This is a deliberate design decision,
and this is what makes *Aaargh* different from its many alternatives.

The docstrings in the `aaargh.py` file contain all information you need to use
*Aaargh*. Refer to the `argparse` documentation for information on specifying
arguments, providing defaults, adding help texts, and so on.


Example
=======

A simple command line application that exposes a few functions looks like
this::

   #!/usr/bin/env python

   import aaargh

   app = aaargh.App(description="A simple greeting application.")

   # Application level arguments:
   app.arg('--name', help="Name of the person to greet", default="stranger")

   # Application level defaults:
   app.defaults(name="visitor")  # overrides "stranger"


   @app.cmd
   def hello(name):  # application level "name" argument is always passed
       print("Hello, world!")


   @app.cmd(name="hi", help="Say hi")  # override subcommand name
   @app.cmd_arg('-r', '--repeat', type=int, default=1, help="How many times?")
   def say_hi(name, repeat):  # both application and subcommand args
       for i in range(repeat):
           print("Hi, %s!" % name)


   @app.cmd
   @app.cmd_defaults(name="my friend")  # overrides "visitor" for this command only
   def greetings(name):
       print("Greetings, %s." % name)


   @app.cmd(alias='bye')  # Allow "bye" aswell as goodbye
   def goodbye(name):
       print("Goodbye, cruel world!")


   if __name__ == '__main__':
       app.run()

The command line interface for this application behaves like this::

   $ ./example.py hello
   Hello, world!

   $ ./example.py hi --repeat=3
   Hi, visitor!
   Hi, visitor!
   Hi, visitor!

   $ ./example.py --help
   usage: example.py [-h] [--name NAME] {hello,hi,greetings} ...

   A simple greeting application.

   optional arguments:
     -h, --help            show this help message and exit
     --name NAME           Name of the person to greet

   Subcommands:
     {hello,hi,greetings}
       hello
       hi                  Say hi
       greetings

   $ ./example.py hi --help
   usage: example.py hi [-h] [-r REPEAT]

   optional arguments:
     -h, --help            show this help message and exit
     -r REPEAT, --repeat REPEAT
                           How many times?


Installation
============

Installation using `pip` is trivial, especially when using `virtualenv`::

   (yourenv) $ pip install aaargh

After succesful installation, this should work::

   (yourenv) $ python
   >>> import aaargh
   >>> help(aaargh)

.. note:

   For Python 2.6 you also need to install the `argparse` module.


History
=======

Version 0.7.1 (2014-03-13)
--------------------------

* Include licensing file in source distribution (issue #9, issue #13)

Version 0.7 (2014-02-18)
------------------------

* Add basic support for command aliases packaging (issue #4, issue #10)

Version 0.6 (2014-02-16)
------------------------

* No longer use `pbr` for packaging (issue #12)
* Add proper licensing file (issue #9)
* Fix error message when calling the program without a subcommand under Python 3

Version 0.5 (2013-09-23)
------------------------

* No longer add global args to subcommands  (issues #3 and #5)
* Switch to `pbr` for packaging

Version 0.4 (2012-10-17)
------------------------

* Fix automatic `argparse` dependency installation when using `pip install` with
  Python 2.6.

Version 0.3 (2012-06-10)
------------------------

* Also accept global args after the subcommand

Version 0.2 (2012-05-17)
------------------------

* Add support for Python 3

Version 0.1 (2012-05-17)
------------------------

* Initial release


.. image:: https://d2weczhvl823v0.cloudfront.net/wbolster/aaargh/trend.png
   :alt: Bitdeli badge
   :target: https://bitdeli.com/free

Downloads & popularity

23downloads
1-day window · source-reported counts19 Oct 2026
72360
2026-07-22: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-22–2026-07-222026-07-23: 14 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-23–2026-07-232026-07-24: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-24–2026-07-242026-07-25: 2 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-25–2026-07-252026-07-26: 14 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-26–2026-07-262026-07-27: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-27–2026-07-272026-07-28: 17 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-28–2026-07-282026-07-29: 16 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-29–2026-07-292026-07-30: 19 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-30–2026-07-302026-07-31: 18 · observed 2026-10-20T16:59:45.7048148Z · period 2026-07-31–2026-07-312026-08-01: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-01–2026-08-012026-08-02: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-02–2026-08-022026-08-03: 17 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-03–2026-08-032026-08-04: 39 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-04–2026-08-042026-08-05: 48 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-05–2026-08-052026-08-06: 23 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-06–2026-08-062026-08-07: 31 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-07–2026-08-072026-08-08: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-08–2026-08-082026-08-09: 13 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-09–2026-08-092026-08-10: 44 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-10–2026-08-102026-08-11: 14 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-11–2026-08-112026-08-12: 15 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-12–2026-08-122026-08-13: 17 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-13–2026-08-132026-08-14: 15 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-14–2026-08-142026-08-15: 17 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-15–2026-08-152026-08-16: 14 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-16–2026-08-162026-08-17: 24 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-17–2026-08-172026-08-18: 72 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-18–2026-08-182026-08-19: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-19–2026-08-192026-08-20: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-20–2026-08-202026-08-21: 12 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-21–2026-08-212026-08-22: 10 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-22–2026-08-222026-08-23: 10 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-23–2026-08-232026-08-24: 19 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-24–2026-08-242026-08-25: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-25–2026-08-252026-08-26: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-26–2026-08-262026-08-27: 13 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-27–2026-08-272026-08-28: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-28–2026-08-282026-08-29: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-29–2026-08-292026-08-30: 6 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-30–2026-08-302026-08-31: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-08-31–2026-08-312026-09-01: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-01–2026-09-012026-09-02: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-02–2026-09-022026-09-03: 3 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-03–2026-09-032026-09-04: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-04–2026-09-042026-09-05: 12 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-05–2026-09-052026-09-06: 4 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-06–2026-09-062026-09-07: 14 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-07–2026-09-072026-09-08: 6 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-08–2026-09-082026-09-09: 10 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-09–2026-09-092026-09-10: 3 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-10–2026-09-102026-09-11: 6 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-11–2026-09-112026-09-12: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-12–2026-09-122026-09-13: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-13–2026-09-132026-09-14: 6 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-14–2026-09-142026-09-15: 13 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-15–2026-09-152026-09-16: 5 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-16–2026-09-162026-09-17: 4 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-17–2026-09-172026-09-18: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-18–2026-09-182026-09-19: 4 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-19–2026-09-192026-09-20: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-20–2026-09-202026-09-21: 20 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-21–2026-09-212026-09-22: 2 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-22–2026-09-222026-09-23: 26 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-23–2026-09-232026-09-24: 21 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-24–2026-09-242026-09-25: 20 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-25–2026-09-252026-09-26: 3 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-26–2026-09-262026-09-27: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-27–2026-09-272026-09-28: 44 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-28–2026-09-282026-09-29: 23 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-29–2026-09-292026-09-30: 16 · observed 2026-10-20T16:59:45.7048148Z · period 2026-09-30–2026-09-302026-10-01: 12 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-01–2026-10-012026-10-02: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-02–2026-10-022026-10-03: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-03–2026-10-032026-10-04: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-04–2026-10-042026-10-05: 3 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-05–2026-10-052026-10-06: 46 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-06–2026-10-062026-10-07: 8 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-07–2026-10-072026-10-08: 23 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-08–2026-10-082026-10-09: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-09–2026-10-092026-10-10: 26 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-10–2026-10-102026-10-11: 30 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-11–2026-10-112026-10-12: 19 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-12–2026-10-122026-10-13: 16 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-13–2026-10-132026-10-14: 7 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-14–2026-10-142026-10-15: 10 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-15–2026-10-152026-10-16: 15 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-16–2026-10-162026-10-17: 4 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-17–2026-10-172026-10-18: 9 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-18–2026-10-182026-10-19: 23 · observed 2026-10-20T16:59:45.7048148Z · period 2026-10-19–2026-10-19
22 Jul19 Oct

pypistats · 90 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-19232026-10-20T16:59:45.7048148Z
2026-10-18 – 2026-10-1892026-10-20T16:59:45.7048148Z
2026-10-17 – 2026-10-1742026-10-20T16:59:45.7048148Z
2026-10-16 – 2026-10-16152026-10-20T16:59:45.7048148Z
2026-10-15 – 2026-10-15102026-10-20T16:59:45.7048148Z
2026-10-14 – 2026-10-1472026-10-20T16:59:45.7048148Z
2026-10-13 – 2026-10-13162026-10-20T16:59:45.7048148Z
2026-10-12 – 2026-10-12192026-10-20T16:59:45.7048148Z
2026-10-11 – 2026-10-11302026-10-20T16:59:45.7048148Z
2026-10-10 – 2026-10-10262026-10-20T16:59:45.7048148Z
2026-10-09 – 2026-10-0972026-10-20T16:59:45.7048148Z
2026-10-08 – 2026-10-08232026-10-20T16:59:45.7048148Z
2026-10-07 – 2026-10-0782026-10-20T16:59:45.7048148Z
2026-10-06 – 2026-10-06462026-10-20T16:59:45.7048148Z
2026-10-05 – 2026-10-0532026-10-20T16:59:45.7048148Z
2026-10-04 – 2026-10-0472026-10-20T16:59:45.7048148Z
2026-10-03 – 2026-10-0372026-10-20T16:59:45.7048148Z
2026-10-02 – 2026-10-0282026-10-20T16:59:45.7048148Z
2026-10-01 – 2026-10-01122026-10-20T16:59:45.7048148Z
2026-09-30 – 2026-09-30162026-10-20T16:59:45.7048148Z
2026-09-29 – 2026-09-29232026-10-20T16:59:45.7048148Z
2026-09-28 – 2026-09-28442026-10-20T16:59:45.7048148Z
2026-09-27 – 2026-09-2792026-10-20T16:59:45.7048148Z
2026-09-26 – 2026-09-2632026-10-20T16:59:45.7048148Z
2026-09-25 – 2026-09-25202026-10-20T16:59:45.7048148Z
2026-09-24 – 2026-09-24212026-10-20T16:59:45.7048148Z
2026-09-23 – 2026-09-23262026-10-20T16:59:45.7048148Z
2026-09-22 – 2026-09-2222026-10-20T16:59:45.7048148Z
2026-09-21 – 2026-09-21202026-10-20T16:59:45.7048148Z
2026-09-20 – 2026-09-2092026-10-20T16:59:45.7048148Z
2026-09-19 – 2026-09-1942026-10-20T16:59:45.7048148Z
2026-09-18 – 2026-09-1872026-10-20T16:59:45.7048148Z
2026-09-17 – 2026-09-1742026-10-20T16:59:45.7048148Z
2026-09-16 – 2026-09-1652026-10-20T16:59:45.7048148Z
2026-09-15 – 2026-09-15132026-10-20T16:59:45.7048148Z
2026-09-14 – 2026-09-1462026-10-20T16:59:45.7048148Z
2026-09-13 – 2026-09-1382026-10-20T16:59:45.7048148Z
2026-09-12 – 2026-09-1252026-10-20T16:59:45.7048148Z
2026-09-11 – 2026-09-1162026-10-20T16:59:45.7048148Z
2026-09-10 – 2026-09-1032026-10-20T16:59:45.7048148Z
2026-09-09 – 2026-09-09102026-10-20T16:59:45.7048148Z
2026-09-08 – 2026-09-0862026-10-20T16:59:45.7048148Z
2026-09-07 – 2026-09-07142026-10-20T16:59:45.7048148Z
2026-09-06 – 2026-09-0642026-10-20T16:59:45.7048148Z
2026-09-05 – 2026-09-05122026-10-20T16:59:45.7048148Z
2026-09-04 – 2026-09-0482026-10-20T16:59:45.7048148Z
2026-09-03 – 2026-09-0332026-10-20T16:59:45.7048148Z
2026-09-02 – 2026-09-0292026-10-20T16:59:45.7048148Z
2026-09-01 – 2026-09-0192026-10-20T16:59:45.7048148Z
2026-08-31 – 2026-08-3152026-10-20T16:59:45.7048148Z
2026-08-30 – 2026-08-3062026-10-20T16:59:45.7048148Z
2026-08-29 – 2026-08-2972026-10-20T16:59:45.7048148Z
2026-08-28 – 2026-08-2852026-10-20T16:59:45.7048148Z
2026-08-27 – 2026-08-27132026-10-20T16:59:45.7048148Z
2026-08-26 – 2026-08-2652026-10-20T16:59:45.7048148Z
2026-08-25 – 2026-08-2552026-10-20T16:59:45.7048148Z
2026-08-24 – 2026-08-24192026-10-20T16:59:45.7048148Z
2026-08-23 – 2026-08-23102026-10-20T16:59:45.7048148Z
2026-08-22 – 2026-08-22102026-10-20T16:59:45.7048148Z
2026-08-21 – 2026-08-21122026-10-20T16:59:45.7048148Z
2026-08-20 – 2026-08-2052026-10-20T16:59:45.7048148Z
2026-08-19 – 2026-08-1982026-10-20T16:59:45.7048148Z
2026-08-18 – 2026-08-18722026-10-20T16:59:45.7048148Z
2026-08-17 – 2026-08-17242026-10-20T16:59:45.7048148Z
2026-08-16 – 2026-08-16142026-10-20T16:59:45.7048148Z
2026-08-15 – 2026-08-15172026-10-20T16:59:45.7048148Z
2026-08-14 – 2026-08-14152026-10-20T16:59:45.7048148Z
2026-08-13 – 2026-08-13172026-10-20T16:59:45.7048148Z
2026-08-12 – 2026-08-12152026-10-20T16:59:45.7048148Z
2026-08-11 – 2026-08-11142026-10-20T16:59:45.7048148Z
2026-08-10 – 2026-08-10442026-10-20T16:59:45.7048148Z
2026-08-09 – 2026-08-09132026-10-20T16:59:45.7048148Z
2026-08-08 – 2026-08-0872026-10-20T16:59:45.7048148Z
2026-08-07 – 2026-08-07312026-10-20T16:59:45.7048148Z
2026-08-06 – 2026-08-06232026-10-20T16:59:45.7048148Z
2026-08-05 – 2026-08-05482026-10-20T16:59:45.7048148Z
2026-08-04 – 2026-08-04392026-10-20T16:59:45.7048148Z
2026-08-03 – 2026-08-03172026-10-20T16:59:45.7048148Z
2026-08-02 – 2026-08-0282026-10-20T16:59:45.7048148Z
2026-08-01 – 2026-08-0152026-10-20T16:59:45.7048148Z
2026-07-31 – 2026-07-31182026-10-20T16:59:45.7048148Z
2026-07-30 – 2026-07-30192026-10-20T16:59:45.7048148Z
2026-07-29 – 2026-07-29162026-10-20T16:59:45.7048148Z
2026-07-28 – 2026-07-28172026-10-20T16:59:45.7048148Z
2026-07-27 – 2026-07-2782026-10-20T16:59:45.7048148Z
2026-07-26 – 2026-07-26142026-10-20T16:59:45.7048148Z
2026-07-25 – 2026-07-2522026-10-20T16:59:45.7048148Z
2026-07-24 – 2026-07-2472026-10-20T16:59:45.7048148Z
2026-07-23 – 2026-07-23142026-10-20T16:59:45.7048148Z
2026-07-22 – 2026-07-2292026-10-20T16:59:45.7048148Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.7.113 Mar 20140

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
wbolster/aaargh

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:47 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:184e91d05fae294c5a60bead80ad013474cd14b96da9121688274e70d65be24d