Metadata-Version: 1.0
Name: argument
Version: 1.3.4
Summary: Command line argument parsing library for python
Home-page: https://github.com/oskarnyqvists/arguments
Author: oskarnyqvist
Author-email: oskarnyqvist@gmail.com
License: The MIT License (MIT)

Copyright (c) 2015 Oskar Nyqvist

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Description: arguments
        =========
        
        Argument parsing for python developers
        
        Usage:
        ------
        
        .. code:: python
        
            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 \`\`\`
        
Platform: UNKNOWN
