Skip to main content

Decorators and wrapper for easily define script's arguments within functions and classes. just defining function's args.

Project description

ArgParseInator

Argparseinator is a silly, but useful, thing that permit you to easily add argparse’s arguments and options to your script directly within functions and classes with the use of some decorators.

Install

pip install argparseinator

Quick example (sayciao.py module)

"""
Say ciao script.
"""

__version__ = "1.2.3"


from argparseinator import ArgParseInator, arg


@arg()
def sayciao(name):
    """
    I will say ciao.
    """
    print "Ciao", name

if __name__ == '__main__':
    ArgParseInator().check_command()

call:

$ python sayciao.py --help

will output:

usage: sayciao.py [-h] [-v] name

Say ciao script.

    I will say ciao.


positional arguments:
  name

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit

call:

$ python sayciao.py --version

will output:

sayciao.py 1.2.3

call:

$ python sayciao.py luca

will output:

Ciao luca

Docs

See readthedocs

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ArgParseInator-1.0.22-py2.py3-none-any.whl (22.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ArgParseInator-1.0.22-py2.py3-none-any.whl.

File metadata

  • Download URL: ArgParseInator-1.0.22-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for ArgParseInator-1.0.22-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 adc55c7e570dc3f5bd880c44ad005cbf4d3ce014307c4e9d865b5242ed9e6fe5
MD5 8e10fc4cf201f987de23e78be8a6b76e
BLAKE2b-256 9d2d080ab7057f34df2b8d236528990bafa71c1ceb8a28e9266c1f00b6bdb9a0

See more details on using hashes here.

Supported by

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