Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Decorators and wrapper makes argparse and CLI more easy

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

Release History

Release History

This version
History Node

1.0.18

History Node

1.0.17

History Node

1.0.16

History Node

1.0.15

History Node

1.0.14

History Node

1.0.13

History Node

1.0.12

History Node

1.0.11

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ArgParseInator-1.0.18-py2.py3-none-any.whl (22.4 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel May 23, 2017
ArgParseInator-1.0.18.tar.gz (15.0 kB) Copy SHA256 Checksum SHA256 Source May 23, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting