-
Notifications
You must be signed in to change notification settings - Fork 103
Python
Matt Harley edited this page Oct 9, 2015
·
4 revisions
- (from https://www.reddit.com/r/Python/comments/3nctlm/what_python_tools_should_i_be_using_on_every/)
- http://gouge.readthedocs.org/en/latest/
# My recommendation is argparse, it's usually more than powerful enough and comes with python. You can even pass in a list of arguments (default of None means that it uses sys.argv) so that you can automate testing of your command line arguments too.
parser.add_argument('-v', '--verbose', action='count', default=0)
parser.add_argument('-q', '--quiet', action='count', default=0)
logging_level = logging.WARN + 10*args.quiet - 10*args.verbose
# script -vv -> DEBUG
# script -v -> INFO
# script -> WARNING
# script -q -> ERROR
# script -qq -> CRITICAL
# script -qqq -> no logging at all
Boltons is a set of over 100 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously missing from — the standard library, including:
- Atomic file saving, bolted on with fileutils
- A highly-optimized OrderedMultiDict, in dictutils
- Two types of PriorityQueue, in queueutils
- Chunked and windowed iteration, in iterutils
- A full-featured TracebackInfo type, for representing stack traces, in tbutils
Boltons is tested against Python 2.6, 2.7, 3.4, and PyPy. Full and extensive docs are available on Read The Docs. See what's new by checking the CHANGELOG.
- ProgressBar - https://pypi.python.org/pypi/progressbar