This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Argument parsing for python developers

Usage:

import argument
f = argument.Arguments()
#Requried arguments, first argument will be stored as "candy"
f.require("candy", help="Candy name")

#optional unnamed value
f.maybe("soda")

#optional value, set a default, can be changed by adding: --num=30, or -n=30
f.option("num",
    25,
    help="How many pieces?",
    abbr="n"
    )
#add a switch, a flag with no argument
f.switch("reverse",
    help="Reverse ordering",
    abbr="r"
)
f.switch("unwrap", help="unwrapcandy", abbr="u")

#Process data before saving it
f.process("candy", lambda x: x.upper())

#Parse num as integer
f.process("num", lambda x: int(x))

f.validate("num", lambda x: x > 10)

#get data
arguments, errors = f.parse()

Example:

python tests/demo.py bubblegum

{‘num’: 25, ‘soda’: None, ‘reverse’: False, ‘candy’: ‘BUBBLEGUM’, ‘unwrap’: False}

python demo.py bubblegum cubacola

{‘num’: 25, ‘soda’: ‘cubacola’, ‘reverse’: False, ‘candy’: ‘BUBBLEGUM’, ‘unwrap’: False}

python tests/demo.py bubblegum -r -n=123 –unwrap

{‘num’: 123, ‘soda’: None, ‘reverse’: True, ‘candy’: ‘BUBBLEGUM’, ‘unwrap’: True}

python tests/demo.py bubblegum –n=5

{‘num’: 5, ‘soda’: None, ‘reverse’: False, ‘candy’: ‘BUBBLEGUM’, ‘unwrap’: False}

Autogenerated help:

print(f) “` Usage: demo.py [OPTIONS] CANDY

Required arguments: CANDY Candy name

Optional arguments: SODA N/A

Options: -n –num=25 How many pieces?

Switches: -r –reverse Reverse ordering -u –unwrap unwrapcandy “`

Release History

Release History

1.4.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
argument-1.4.0.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Feb 12, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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