When they're not builtins, they're boltons.
Project description
Boltons
boltons should be builtins.
Boltons is a set of over 230 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
- Recursive data structure iteration and merging, with iterutils.remap
- Exponential backoff functionality, including jitter, through iterutils.backoff
- A full-featured TracebackInfo type, for representing stack traces, in tbutils
Full and extensive docs are available on Read The Docs. See what's new by checking the CHANGELOG.
Boltons is tested against Python 3.7-3.14, as well as PyPy3.
Installation
Boltons can be added to a project in a few ways. There's the obvious one:
pip install boltons
On macOS, it can also be installed via MacPorts:
sudo port install py-boltons
Then, thanks to PyPI, dozens of boltons are just an import away:
from boltons.cacheutils import LRU
my_cache = LRU()
However, due to the nature of utilities, application developers might want to consider other options, including vendorization of individual modules into a project. Boltons is pure-Python and has no dependencies. If the whole project is too big, each module is independent, and can be copied directly into a project. See the Integration section of the docs for more details.
Third-party packages
The majority of boltons strive to be "good enough" for a wide range of
basic uses, leaving advanced use cases to Python's myriad specialized
3rd-party libraries. In many cases the respective boltons module
will describe 3rd-party alternatives worth investigating when use
cases outgrow boltons. If you've found a natural "next-step"
library worth mentioning, see the next section!
Gaps
Found something missing in the standard library that should be in
boltons? Found something missing in boltons? First, take a
moment to read the very brief architecture statement
to make sure the functionality would be a good fit. It covers the
design philosophy, what belongs in boltons, and how modules are
organized.
Then, if you are very motivated, submit a Pull Request. Otherwise, submit a short feature request on the Issues page, and we will figure something out.
Development
Install uv, then set up a dev environment:
uv venv && uv pip install -e .
Run the test suite (includes doctests):
uvx --with tox-uv tox -e py314
Run all environments in parallel:
uvx --with tox-uv tox -p auto
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boltons-26.0.0.tar.gz.
File metadata
- Download URL: boltons-26.0.0.tar.gz
- Upload date:
- Size: 225.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5566d6cfd5a1e873d8e8476496287a9f92979964611ad9a9cecb6b0ef29b1edd
|
|
| MD5 |
4c06759a60c7ad6348715c1fec8a262e
|
|
| BLAKE2b-256 |
7a1f60df922ae497d838c58b48caa518251e2c8e228d7fe93792fee69a3858d6
|
Provenance
The following attestation bundles were made for boltons-26.0.0.tar.gz:
Publisher:
publish.yml on mahmoud/boltons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boltons-26.0.0.tar.gz -
Subject digest:
5566d6cfd5a1e873d8e8476496287a9f92979964611ad9a9cecb6b0ef29b1edd - Sigstore transparency entry: 1867946425
- Sigstore integration time:
-
Permalink:
mahmoud/boltons@fb464991b718ca7bfabc14555c2947f25e7c79c9 -
Branch / Tag:
refs/tags/26.0.0 - Owner: https://github.com/mahmoud
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb464991b718ca7bfabc14555c2947f25e7c79c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file boltons-26.0.0-py3-none-any.whl.
File metadata
- Download URL: boltons-26.0.0-py3-none-any.whl
- Upload date:
- Size: 195.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba077cac51b27532299634f87f5589b4080fa94a011b4d43a9247f775e9215c7
|
|
| MD5 |
f4c2e9380976b0e51f09a697e9db5d63
|
|
| BLAKE2b-256 |
00014001033457f25ecdc2b1ffd513ca0b76200b9ea009dd64f6c1aad2dde133
|
Provenance
The following attestation bundles were made for boltons-26.0.0-py3-none-any.whl:
Publisher:
publish.yml on mahmoud/boltons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boltons-26.0.0-py3-none-any.whl -
Subject digest:
ba077cac51b27532299634f87f5589b4080fa94a011b4d43a9247f775e9215c7 - Sigstore transparency entry: 1867946509
- Sigstore integration time:
-
Permalink:
mahmoud/boltons@fb464991b718ca7bfabc14555c2947f25e7c79c9 -
Branch / Tag:
refs/tags/26.0.0 - Owner: https://github.com/mahmoud
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb464991b718ca7bfabc14555c2947f25e7c79c9 -
Trigger Event:
push
-
Statement type: