# mahmoud/boltons

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/mahmoud-boltons).**

6,897 stars · 395 forks · Python · NOASSERTION

## Links

- GitHub: https://github.com/mahmoud/boltons
- Homepage: https://boltons.readthedocs.org
- awesome-repositories: https://awesome-repositories.com/repository/mahmoud-boltons.md

## Description

Boltons is a comprehensive utility toolkit and extension of the Python standard library. It provides a collection of reusable recipes and specialized data structures, system utilities, and helper libraries designed to support common programming tasks across various domains.

The project is distinguished by a standard-library-only dependency model, ensuring maximum portability with zero external dependencies. It provides advanced implementations for data structures, such as immutable mappings and priority queues, alongside recursive data transformation tools for reshaping complex nested dictionaries and lists.

Its broader capability surface includes system and file management through atomic writes and path expansion, network reliability tools like exponential backoff, and command line interface development helpers. It also covers performance optimization via property memoization and cache invalidation, as well as observability tools for structured traceback parsing and callable object tracing.

## Tags

### Programming Languages & Runtimes

- [Specialized Data Structures](https://awesome-repositories.com/f/programming-languages-runtimes/specialized-data-structures.md) — Ships advanced implementations of priority queues, immutable mappings, and recursive data transformers.
- [Python Tooling](https://awesome-repositories.com/f/programming-languages-runtimes/python-tooling.md) — Acts as a comprehensive utility toolkit providing reusable recipes for common Python programming tasks.
- [Standard Library Extensions](https://awesome-repositories.com/f/programming-languages-runtimes/standard-library-extensions.md) — Extends the Python standard library with reusable recipes and specialized utilities while maintaining zero external dependencies.
- [Iterable Flatteners](https://awesome-repositories.com/f/programming-languages-runtimes/iterable-flatteners.md) — Provides a utility to collapse nested sequences or iterators into a single flat stream of elements. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Key Filtering](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/dictionaries/key-filtering.md) — Provides a utility to extract a new dictionary containing only a specified subset of keys from an original mapping. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Non-Overwriting Updates](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/dictionaries/non-overwriting-updates.md) — Ships a utility to merge key-value pairs into a dictionary only if the keys do not already exist. ([source](https://github.com/mahmoud/boltons/blob/master/TODO.rst))

### Data & Databases

- [Immutable Maps](https://awesome-repositories.com/f/data-databases/hash-maps/immutable-maps.md) — Implements frozen dictionaries that prevent the modification of keys and values after creation. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Recursive Data Explorers](https://awesome-repositories.com/f/data-databases/recursive-data-explorers.md) — Provides utilities to traverse nested data structures and apply transformation functions based on custom entry rules. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Recursive Data Transformers](https://awesome-repositories.com/f/data-databases/recursive-data-transformers.md) — Traverses and modifies nested dictionaries and lists to reshape complex data structures using custom mapping rules.
- [Dictionary Indexes](https://awesome-repositories.com/f/data-databases/dictionary-indexes.md) — Provides a utility to create sub-dictionaries as indexes over a dataset to speed up lookups. ([source](https://github.com/mahmoud/boltons/blob/master/TODO.rst))
- [Multi-Value Dictionaries](https://awesome-repositories.com/f/data-databases/multi-value-dictionaries.md) — Provides a data structure that allows multiple values for a single key while preserving insertion order. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))

### Development Tools & Productivity

- [CLI Development Helpers](https://awesome-repositories.com/f/development-tools-productivity/cli-development-helpers.md) — Provides a suite of helpers for rendering progress bars, escaping shell arguments, and prompting users in the terminal.
- [Shell Argument Escapers](https://awesome-repositories.com/f/development-tools-productivity/command-argument-parsers/shell-argument-escapers.md) — Provides a utility to escape and combine command line arguments into a single string safe for shell execution. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Traceback Filters](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/traceback-filters.md) — Implements traceback folding to collapse repeated frames and reduce noise in recursive call stacks. ([source](https://github.com/mahmoud/boltons/blob/master/TODO.rst))
- [Traceback Structurers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/traceback-filters/traceback-structurers.md) — Transforms raw system stack traces into structured objects to facilitate error analysis and recursive call noise reduction.

### Networking & Communication

- [Network Reliability](https://awesome-repositories.com/f/networking-communication/network-reliability-diagnostics/network-reliability.md) — Implements exponential backoff and socket buffering to ensure stable connections and complete message delivery.

### Operating Systems & Systems Programming

- [File System Operations](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/file-system-management/file-system-operations.md) — Provides utilities for atomic file writes, recursive directory searches, and shell path expansions.
- [System Utility Helpers](https://awesome-repositories.com/f/operating-systems-systems-programming/system-utility-helpers.md) — Provides low-level system helpers for atomic file saving, path expansion, and network socket buffering.

### Software Engineering & Architecture

- [Lazy Dataset Iterators](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/data-handling-throughput/large-dataset-optimizations/lazy-dataset-iterators.md) — Implements memory-efficient processing of large datasets using sliding windows, chunking, and flattening.
- [Nested Data Transformers](https://awesome-repositories.com/f/software-engineering-architecture/recursive-validation-engines/recursive-tree-traversers/data-structure-traversers/nested-data-transformers.md) — Provides recursive traversal tools to map and transform elements within nested data structures using custom rules.
- [Recursive Data Remapping](https://awesome-repositories.com/f/software-engineering-architecture/trie-data-structures/recursive-data-remapping.md) — Traverses nested data structures to transform or merge values recursively based on defined rules. ([source](https://github.com/mahmoud/boltons/blob/master/README.md))
- [Zero-Dependency Libraries](https://awesome-repositories.com/f/software-engineering-architecture/zero-dependency-libraries.md) — Ensures maximum portability by implementing all features using only the Python standard library with zero external dependencies.
- [Atomic File Writes](https://awesome-repositories.com/f/software-engineering-architecture/atomic-file-writes.md) — Provides atomic file write operations that use temporary files to prevent data corruption during crashes.
- [Traceback Parsing](https://awesome-repositories.com/f/software-engineering-architecture/exception-traceback-capture/traceback-parsing.md) — Transforms raw traceback strings into structured objects for easier analysis and serialization. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [Disk-Memory Thresholds](https://awesome-repositories.com/f/software-engineering-architecture/memory-buffering/disk-memory-thresholds.md) — Implements a system to store data in memory and spill to disk automatically when a size threshold is exceeded. ([source](https://github.com/mahmoud/boltons/blob/master/CHANGELOG.md))
- [LRU Cache Eviction](https://awesome-repositories.com/f/software-engineering-architecture/memory-management/lru-cache-eviction.md) — Implements a least-recently-used (LRU) eviction policy to maintain a fixed-size memory pool.
- [Priority Queues](https://awesome-repositories.com/f/software-engineering-architecture/queue-implementations/priority-queues.md) — Provides a priority queue implementation where the highest priority item is processed first. ([source](https://github.com/mahmoud/boltons/blob/master/README.md))
- [Stack Trace Formatters](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters.md) — Represents traceback information as structured types to improve error reporting and debugging. ([source](https://github.com/mahmoud/boltons#readme))

### User Interface & Experience

- [Command-Line Interface Development](https://awesome-repositories.com/f/user-interface-experience/ui-architecture/command-line-interface-development.md) — Provides a toolkit for building terminal applications with progress bars, user prompts, and safe shell argument formatting.
- [CLI Confirmation Prompts](https://awesome-repositories.com/f/user-interface-experience/cli-confirmation-prompts.md) — Implements a terminal utility to ask yes/no questions and capture user responses to validate specific actions. ([source](https://github.com/mahmoud/boltons/blob/master/TODO.rst))

### Education & Learning Resources

- [Sliding Window Algorithms](https://awesome-repositories.com/f/education-learning-resources/sliding-window-algorithms.md) — Implements a sliding-window iterator to produce overlapping groups of elements from a sequence.

### System Administration & Monitoring

- [Terminal Progress Indicators](https://awesome-repositories.com/f/system-administration-monitoring/activity-monitors/activity-progress-monitors/task-progress-monitors/terminal-progress-indicators.md) — Implements a visual progress bar for the terminal to track the completion status of long-running tasks. ([source](https://github.com/mahmoud/boltons/blob/master/TODO.rst))

### Web Development

- [State-Based Invalidation](https://awesome-repositories.com/f/web-development/cache-invalidation-strategies/state-based-invalidation.md) — Uses a dirty-bit mechanism to automatically invalidate cached property values when an object's state changes.

### Part of an Awesome List

- [General Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/general-utilities.md) — Provides a collection of pure-Python utility functions and data structures.
