more-itertools: chunked, peekable and the rest of the iterable toolbox
More routines for operating on iterables, beyond itertools
At a glance
- What is it?
- more-itertools extends Python's itertools with grouping, lookahead and windowing routines. Here is what the library contains, how it is built and tested, and where it stops being the right choice.
- Who is it for?
- Adopt more-itertools if you write Python 3.10 or newer and keep rewriting the same chunking, peeking or windowing loops by hand; the library is MIT licensed, the latest release on record is v11.1.0 from 2026-05-22, and the last push to master was on 2026-09-21. Do not adopt it if you are pinned below Python 3.10, since pyproject.toml sets requires-python to >=3.10, or if you need a routine the README's tables do not list.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 21, 2026, and from our analysis. They are not legal advice.
Star history
- more-itertools/more-itertools4,106 ★ · +11
| Repository | 2026-09-23 | 2026-11-21 |
|---|---|---|
| more-itertools/more-itertools | 4.1k | 4.1k |
11 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The gap more-itertools fills next to itertools
The standard library's itertools gives you the primitives: count, cycle, chain, groupby, islice. What it does not give you is the everyday glue. Splitting a stream into fixed-size batches, looking one element ahead without consuming it, or sliding a window across a sequence all require a hand-written generator, and those generators are easy to get subtly wrong at the boundaries. more-itertools collects those routines so you do not rewrite them per project.
The README frames it plainly: Python's itertools is described as a gem, and more-itertools is where the project collects "additional building blocks, recipes, and routines for working with Python iterables." The audience is Python developers who already reach for itertools and want the next layer. The README's own tables are the clearest statement of scope, organising the API into grouping, lookahead and lookback, and windowing categories rather than by alphabetical order.
Grouping, lookahead and windowing: how the API is organised
The grouping table is the largest. It lists chunked, ichunked, chunked_even, sliced, constrained_batches, distribute, divide, split_at, split_before, split_after, split_into, split_when, bucket, unzip, batched, grouper and partition. The names encode the distinction that matters: chunked returns materialised chunks, ichunked returns an iterator of iterators, and chunked_even balances the last chunk so sizes differ by at most one. If your input is a generator you cannot rewind, ichunked is the one that does not pull everything into memory first.
Lookahead and lookback is a three-function category: spy, peekable and seekable. peekable wraps an iterable so you can call peek() and inspect the next item without consuming it, which is the standard fix for parsers that need one token of lookahead. seekable goes further and allows moving backwards, at the cost of caching what it has already seen. The windowing table covers windowed, substrings, substrings_indexes, stagger, windowed_complete, pairwise, triplewise, sliding_window and subslices, so both fixed-width windows and overlapping n-grams have a named function.
One design point worth flagging: several of these functions overlap with the standard library. pairwise and batched exist in modern CPython, and the README still lists them. That is a compatibility choice, not redundancy. Code that targets a range of Python versions can import one name from one place instead of branching on sys.version_info.
What the repository layout says about building and testing
The repository root holds more_itertools/, tests/, docs/, requirements/, a Makefile, a tox.ini and a pyproject.toml. That layout is worth reading before you depend on the library, because it tells you how the maintainers verify behaviour. The Makefile defines an all-checks target that chains requirements, coverage, check, docs and package, so the release path runs the full set rather than a subset.
The check target is the interesting one. It runs ruff format --check ., then ruff check more_itertools tests, then stubtest more_itertools.more more_itertools.recipes. That last command type-checks the shipped stubs against the actual implementation, which is why the package ships a .pyi file alongside the module. The coverage target installs requirements/testing.txt, runs the unittest suite under coverage with --include="more_itertools/*.py", and reports with --show-missing --fail-under=99. A 99 percent floor means a new function without tests fails the build.
For packaging, the Makefile's package target installs requirements/packaging.txt, runs flit build, then twine check dist/*. pyproject.toml confirms the build backend is flit_core with requires = ["flit_core >=4,<5"], and declares no runtime dependencies. The docs target runs sphinx-build -W -b html docs docs/_build/html, where -W turns warnings into errors. Documentation that references a renamed function breaks the build.
Where more-itertools is the wrong tool
The version floor is the hardest constraint. pyproject.toml sets requires-python to ">=3.10" and the classifiers list 3.10 through 3.14 plus PyPy. If your deployment target is 3.9 or older, pip will refuse the install, and no amount of pinning an older release is described in the README as a supported path. Check your interpreter before you add the dependency.
Laziness is the second trap. chunked materialises each chunk as a list, so chunking a very large stream with a large size holds that much memory at once. The README's table gives ichunked as the iterator-of-iterators alternative, but the README itself does not spell out the memory trade-off; you have to infer it from the names and the API documentation. Treat the table as a menu, not as guidance.
Finally, several functions here replace three-line loops. If your project already depends on a data-processing framework that supplies its own batching and windowing, adding more-itertools on top gives you two vocabularies for the same operation. The library is most valuable in codebases that stay close to the standard library and want to keep doing so.
more-itertools against the standard library and toolz
The obvious alternative is not installing anything. itertools.groupby plus islice can produce chunks, and a two-line zip trick produces pairwise. The difference is boundary behaviour: the standard-library recipes leave the last-chunk handling, the fill value and the even-split case to you, and each of those is a place where an off-by-one hides. more-itertools names those cases as separate functions, so the choice is visible in the call site rather than buried in a generator body.
A second comparison point is toolz, which also ships iterable utilities but is built around a functional-programming style with currying and composition at its centre. more-itertools stays closer to itertools in shape: functions take an iterable and return an iterable, with no currying layer. If your codebase already reads like itertools, more-itertools is the smaller conceptual jump. If you want pipelines composed from partially applied functions, toolz is the more natural fit. The two are not mutually exclusive, but importing both for the same batching job is a sign you have not picked one.
Maintenance, releases and the MIT licence
The repository is not archived, and the last push to master was on 2026-09-21. The most recent release on record is v11.1.0, dated 2026-05-22, preceded by v11.0.2 on 2026-04-09 and v11.0.1 on 2026-04-02. That is a steady cadence of patch and minor releases rather than a frozen library.
The upgrade cost is low by design. The package is pure Python with a single build dependency, flit_core, and no runtime dependencies are declared in pyproject.toml. Upgrading means changing one version pin. The risk surface is the API itself: the project ships a pyi stub file and the Makefile runs stubtest against more_itertools.more and more_itertools.recipes as part of its check target, so type signatures are verified in CI. The Makefile also enforces coverage with --fail-under=99, which tells you the test suite is expected to be near-complete; it does not tell you the functions behave the way you want.
The licence is MIT, declared both in the LICENSE file and in pyproject.toml via license = "MIT" and license-files = ["LICENSE"]. MIT is permissive: you can use, modify and redistribute the code, including in closed-source products, provided the copyright notice and permission notice are retained. That is a description of the licence text, not legal advice; if your organisation has a policy on third-party licences, route the LICENSE file through it.
Editorial conclusion
Adopt more-itertools if you write Python 3.10 or newer and keep rewriting the same chunking, peeking or windowing loops by hand; the library is MIT licensed, the latest release on record is v11.1.0 from 2026-05-22, and the last push to master was on 2026-09-21. Do not adopt it if you are pinned below Python 3.10, since pyproject.toml sets requires-python to >=3.10, or if you need a routine the README's tables do not list. Before adding it to a dependency file, open the API page for the specific function you plan to use and read its signature, because the README only names functions and links out.
Frequently asked questions
What is meant by itertools in Python?
itertools is the standard library module the README calls a gem, providing composable functions for working with iterables. more-itertools is the companion library that adds further building blocks, recipes and routines on top of it.
What does the itertools product do?
The README does not describe itertools.product; it only references the standard itertools module as the foundation more-itertools builds on. For product itself, consult the standard library documentation.
Is Python itertools built in?
Yes, itertools is part of the standard library, and the README treats it as the baseline that more-itertools extends. more-itertools itself is a separate package you install from PyPI.
What does "iterable" mean?
The README does not define the term. Its tables describe functions that operate on Python iterables, so the working definition is whatever the standard library means by an object you can iterate over.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/more-itertools-more-itertools)Star history chart for your README
[](https://hysenlabs.com/projects/more-itertools-more-itertools)Was this useful?