Repolode
mahmoud

mahmoud/boltons

A pure-Python utility library of 230+ extra constructs that extend the standard library, with no dependencies.

Stars
6,940
Forks
484
Open issues
174
Last commit
last month

What is it?

Boltons is a collection of over 230 BSD-licensed, pure-Python utilities that fill gaps the standard library leaves open. Its modules cover data structures such as an OrderedMultiDict and two kinds of priority queue, iteration helpers like chunked and windowed, recursive structure traversal and merging with remap, and exponential backoff with jitter.

Other modules handle practical tasks: atomic file saving, a full-featured TracebackInfo type for representing stack traces, and caching utilities such as an LRU cache. The project depends on nothing beyond the standard library and is tested against Python 3.7 through 3.14 as well as PyPy3.

Boltons can be installed from PyPI or conda-forge, or individual modules can be copied directly into a project, since each one is independent.

Key features

  • 01Pure Python with no third-party dependencies.
  • 02Data structures such as OrderedMultiDict and two priority queue types.
  • 03Iteration helpers including chunked, windowed, and recursive remap.
  • 04Exponential backoff with jitter.
  • 05Atomic file saving and a detailed TracebackInfo type.
  • 06Each module can be vendored independently into a project.

Use cases

  • Adding chunking, windowing, or nested-structure traversal to a Python codebase without new dependencies.
  • Writing crash-safe file updates with atomic saves.
  • Implementing retry logic with exponential backoff and jitter.
  • Capturing and formatting stack traces for logging or error reporting.

Quick start

  1. 1

    Install boltons from PyPI

    pip install boltons
  2. 2

    Import a utility and use it

    from boltons.cacheutils import LRU

Things to know

  • License is listed as NOASSERTION in metadata, so the license should be checked before use.
  • Individual modules are not a substitute for specialized third-party libraries once use cases grow.

In collections

Topics

FAQ

What is boltons?
A pure-Python utility library of 230+ extra constructs that extend the standard library, with no dependencies. Boltons is a collection of over 230 BSD-licensed, pure-Python utilities that fill gaps the standard library leaves open. Its modules cover data structures such as an OrderedMultiDict and two kinds of priority queue, iteration helpers like chunked and windowed, recursive structure traversal and merging with remap, and exponential backoff with jitter.
Is boltons free to use? What license does it have?
boltons is open source under the Other license. Check the license terms before using it in commercial products.
Is boltons still maintained?
Updated within 6 months. The last commit to boltons was on Sep 23, 2026.
What can I use boltons for?
Adding chunking, windowing, or nested-structure traversal to a Python codebase without new dependencies. Writing crash-safe file updates with atomic saves. Implementing retry logic with exponential backoff and jitter. Capturing and formatting stack traces for logging or error reporting.
How do I install boltons?
Install boltons from PyPI: pip install boltons Import a utility and use it: from boltons.cacheutils import LRU
Where can I get boltons?
The source code and installation instructions are on GitHub: https://github.com/mahmoud/boltons

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects