argfarceDeclarative wrapper for argparse | |
Download |
argfarce Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Ken Kinder
- Publisher web site:
- http://kkinder.com/
argfarce Tags
argfarce Description
argfarce is a Python module that makes it easy to declare argparse structures. Consider this example:>>> class PersonalInfoParser(ArgumentParser):... class Meta:... prog = 'person.py'...... name = Argument('-n', help="Cheese to use on your sandwich", required=False)... profession = Argument('-p', '--profession', choices=('developer', 'programmer', 'software engineer'), help="These are all pretty much the same", required=False)... comments = Argument(nargs='*')...>>> parser = PersonalInfoParser()>>> parser.parse_args('-p programmer -n Ken foo bar spam'.split())>>> print parser.nameKen>>> print parser.professionprogrammer>>> print parser.commentsThis software is not yet compatible with Python 3.Product's homepage
argfarce Related Software