boltons

Set of pure-Python utility functions for common programming tasks.

pipmacoslinuxwindows
Try with needOr install directly
Source

About

When they're not builtins, they're boltons.

Examples

pretty print and validate JSON from command line$ python -m boltons.jsonutils < data.json
convert between different data structures in Python$ python -c "from boltons.dictutils import OneToOne; m = OneToOne(); m['key'] = 'value'"
split large lists into smaller chunks for batch processing$ python -c "from boltons.iterutils import chunked; list(chunked(range(10), 3))"
truncate long strings with ellipsis for display$ python -c "from boltons.strutils import slugify; slugify('Hello World!')"
cache function results to avoid repeated calculations$ python -c "from boltons.cacheutils import cachedproperty; print(cachedproperty.__doc__)"