Skip to main content

specify command arguments in function decorator

Project description


Specify command line arguments using decorators::

from argdeco import main, arg, opt

arg("--foo", help="some argument"),
opt("--flag", '-f', help="toggle flag"),
def my_main_function(foo, flag):
return 0 # success, will be exit code

if __name__ == '__main__':

argdeco is an argparse wrapper.

* ``arg()`` is only a wrapper around ``argparse.ArgumentParser.add_argument()``.
* ``opt()`` is a shorthand for ``arg(..., action=store_true, default=False)``

... you can do `much more`_

.. [much more]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for argdeco, version 2.1.7
Filename, size File type Python version Upload date Hashes
Filename, size argdeco-2.1.7.tar.gz (16.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page