more-itertools adds recipes and helpers for grouping, slicing, combining, and analyzing Python iterables. Install it with pip and import from the top-level package.
Overview
more-itertools extends the standard itertools idea with a large catalog of functions for working with Python iterables. It groups operations for chunking and splitting, lookahead and peeking, windowed views, interleaving and flattening, summarizing, selecting, math, combinatorics, statistics, and wrapper utilities.
Documentation includes recipes from the official itertools docs plus new helpers such as chunked, spy, peekable, and batched-style workflows shown in quickstart examples. Functions are meant to compose in pipelines over lazy iterators without unnecessary materialization where possible.
You add it as a dependency with pip install more-itertools and import symbols from more_itertools in application or library code. The API reference lists each function by category for discovery.
Maintainers coordinate changes through issues before most pull requests, with a narrow exception for documentation typos.
Key features
- Chunking, splitting, and grouping iterables
- Peekable and seekable iterator utilities
- Windowed and pairwise sequence views
- Interleave, flatten, and round-robin helpers
- Unique, filter, and slice selection tools
- Combinatorics and permutation helpers
- Running min/max/mean statistics iterators
- Included itertools documentation recipes
Use cases
- Batching records from large streams
- Previewing iterator heads without consuming
- Combining multiple sorted iterables
- Declarative data processing in Python
- Replacing ad-hoc loop boilerplate