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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ArgParseInator-1.0.17.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for ArgParseInator-1.0.17-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ddf22682c090fe3150ca3dd0e9e8c705d6c0e7211dab3eb58ad46b7ec25728 |
|
MD5 | 1c9a38cb23895b498a2b1c9a7175eb60 |
|
BLAKE2b-256 | fb7d0be8155dd63ceb3f2e9bb56825cb2c00d0ce25f1a5c66d5ab44725fd0322 |