Boltons bundles hundreds of BSD-licensed Python helpers—dicts, queues, files, iteration, stats, URLs, and more—with no third-party dependencies.
Overview
Boltons is a collection of pure-Python utility modules meant to fill gaps left by the standard library. It ships dozens of types and functions across areas such as atomic file writes, ordered and multi-mappings, priority queues, chunked iteration, backoff with jitter, traceback helpers, JSON lines, URL parsing, string and table utilities, and online statistics.
Each module is independent, so teams can install the whole package from PyPI or vendor individual files into a project when only one helper is needed. The design favors practical, readable APIs for everyday scripting and application code rather than replacing specialized third-party libraries; module docs often point to heavier packages when requirements grow.
The project tracks current CPython and PyPy releases and documents modules on Read the Docs with an architecture note explaining what belongs in Boltons versus upstream. macOS users can also install via MacPorts.
Boltons helps Python developers who want batteries-included helpers for data manipulation, filesystem safety, and debugging without pulling a large framework or many separate micro-dependencies.
Key features
- Atomic file saving
- OrderedMultiDict and mapping types
- Priority queue implementations
- Itertools-style iteration utilities
- TracebackInfo stack traces
- Statistics and robust moments
- URL and string helpers
- Zero third-party dependencies
Use cases
- Safer filesystem writes
- Advanced dict and set patterns
- CLI and script ergonomics
- Data cleanup and formatting
- Lightweight stats in applications