skip to navigation
skip to content

Not Logged In

pycli_tools 1.7.1

A python module to help create predictable command line tools for python >= 2.6 and 3.x

Package Documentation

Latest Version: 1.7.2

A python module to help create predictable command line tools for python >= 2.6 and 3.x

pycli_tools is a python module that wraps the ArgumentParser class from the build-in argparse module.

If you use it in your command line scripts you will get some defaults options added to your application such as --verbose and --quiet to control the verbosity of your application (using the python logging module).

Also there is the --config option that gives you the ability to read command line arguments from a configuration file to save users of your application a lot of typing (e.g. ~/.myapprc).

Copyright (c) 2013 Nico Di Rocco.
License: MIT (see LICENSE for details).

installation

The easiest way is to install using pip:

$ pip install pycli_tools

Read the documentation for alternative ways of installing.

usage

To create a myapp command that reads its default configuration from ~/.myapprc do this:

from pycli_tools.parsers import get_argparser

parser = get_argparser(prog='myapp', default_config='~/.myapprc')
parser.add_argument('--database')
parser.add_argument('file')
args = parser.parse_args()

The file ~/.myapprc can contain the following:

[myapp]
database = /some/path/to/my/database.sqlite

Read the documentation to see how to use pycli_tools.

documentation

Read the full documentation here.

 
File Type Py Version Uploaded on Size
pycli_tools-1.7.1.tar.gz (md5) Source 2013-12-30 6KB
  • Downloads (All Versions):
  • 12 downloads in the last day
  • 210 downloads in the last week
  • 867 downloads in the last month