skip to navigation
skip to content

ArgParseInator 1.0.18

Decorators and wrapper makes argparse and CLI more easy

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

 
File Type Py Version Uploaded on Size
ArgParseInator-1.0.18-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2017-05-23 21KB
ArgParseInator-1.0.18.tar.gz (md5) Source 2017-05-23 14KB