argparse_config /

Filename Size Date modified Message
argparse_config.src
82 B
1.6 KB
353 B

What is this I don't even

Yes well I don't blame you. First things first: it's a Python utility for your commandline scripts. What does it do? The elevator pitch is:

The argparse_config utility reads defaults for commandline args from a config file. The cute thing is, it figures out what config options to expect based on your argparse commandline args definition.

It looks like this:

>>> # first prepare arg_parser from the argparse module, then:
>>> import argparse_config
>>> argparse_config.read_config(arg_parser, '/home/tikitu/.my_config_file.cfg')

More details ("But what does this mean for me?!) on PyPI, or you can check the bleeding edge docs.

Installing for use

It's on PyPI:

$ pip install argparse_config

Installing for hackery

You'll need a unix-style environment (linux, terminal in a mac, or similar), with python and hg installed and virtualenv. (If you know enough to question whether you need virtualenv you probably don't need my advice.)

$ hg clone https://tikitu@bitbucket.org/tikitu/argparse_config
$ cd argparse_config
$ virtualenv --no-site-packages .
$ bin/pip install zc.buildout
$ bin/buildout

Testing

After installing for hackery as above:

$ source bin/activate
$ cd argparse_config.src/
$ python setup.py nosetests
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.