Skip to main content

specify command arguments in function decorator

Project description

argdeco
=======

Specify command line arguments using decorators::

from argdeco import main, arg, opt

@main(
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__':
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] https://python-argdeco.readthedocs.io

Project details


Download files

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

Source Distribution

argdeco-2.0.9.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file argdeco-2.0.9.tar.gz.

File metadata

  • Download URL: argdeco-2.0.9.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.15rc1

File hashes

Hashes for argdeco-2.0.9.tar.gz
Algorithm Hash digest
SHA256 f5d9c32bf5937228c0b3fa62479fce15da8c59b83aae4e863d10bf8c431ab65b
MD5 0820e21126c6ab00991cb221daf41cd2
BLAKE2b-256 97dd88aa557d705d1f286b8a25834be9057c8b01ab35d6fdb43c9341b4db8d72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page