more-itertools

More routines for operating on iterables, beyond Python's built-in itertools

Library
PyPI
v11.1.0
4,090stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity96
Maintenance84
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture78
Code Quality85
Innovation70
Learning Curve75

more-itertools extends Python’s standard library itertools module with a large collection of additional iterator-processing functions — chunking, windowing, grouping, peeking, deduplication, flattening, and dozens of other recipes for working with iterables efficiently and lazily. Many of the functions originate from the “itertools recipes” section of the official Python documentation, formalized and battle-tested into a stable public API.

Because it fills gaps left by the standard library without introducing heavyweight dependencies, more-itertools is one of the most widely used utility packages in the Python ecosystem (tens of millions of weekly downloads), commonly pulled in transitively by tools like pip, Sphinx, and other core Python infrastructure.

What You Get

  • Chunking and windowing functions (chunked, sliding_window, windowed, ichunked) for processing iterables in fixed-size or overlapping groups
  • Peeking and lookahead utilities (peekable, spy, first, last) for inspecting upcoming items without consuming the iterator
  • Grouping and partitioning functions (bucket, partition, split_at, split_before, split_after) for splitting a stream by predicate
  • Deduplication and set-like operations (unique_everseen, unique_justseen, duplicates_everseen) that preserve original ordering
  • Flattening and combining utilities (flatten, collapse, interleave, roundrobin, zip_broadcast) for working with nested or multiple iterables
  • A numeric_range generalizing the built-in range() to floats and other numeric types

Common Use Cases

  • Data pipeline code that needs to process large or infinite iterables in fixed-size batches without loading everything into memory
  • CLI tools and scripts implementing lookahead parsing logic using peekable instead of manually buffering items
  • Deduplicating a stream of records while preserving order, without the overhead of sorting or a full set-based approach
  • Splitting a sequence into groups by a predicate (e.g. runs of consecutive items) for report generation or log analysis

Under The Hood

Architecture: The library deliberately has just two source modules — more_itertools/recipes.py (1,620 lines, implementing the documented itertools recipes) and more_itertools/more.py (5,557 lines, the larger set of original additions) — both re-exported flatly through more_itertools/__init__.py, so the entire public API is a single flat namespace with no submodule structure to learn. Tech Stack: Pure Python 3.10+ with zero runtime dependencies, built with Flit (flit_core build backend) rather than setuptools, keeping the packaging surface minimal; a requirements/ directory separates dev/test/docs dependency sets. Code Quality: Despite the large function count, the tests/ directory (organized into a handful of test modules covering recipes and more separately) maintains extensive doctest coverage embedded directly in each function’s docstring in addition to standalone unit tests — a pattern that keeps documentation and correctness verification tied together; the project has a long, consistent release history and 40k+ lines of README documenting every function with runnable examples. API Design: Every function follows itertools’ own conventions (lazy iterator returns, composable with itertools functions directly, consistent keyword-argument naming across similar functions like chunked/sliced/windowed), so users already familiar with itertools can adopt new functions with minimal additional learning.

Used by 6 apps in this directory

Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Go
56%
Apache 2.0

OSV.dev

Security

2,888

Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.

View details
90
Repo Health
82
Technical
70
Dependency
Built with
Go56%
Python32%
Updated today
Python
55%
Other

PostHog

Analytics · Monitoring · Developer Tools

37,777

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
67
Dependency
Built with
Python55%
TypeScript36%
Updated today
Rust
89%
Apache 2.0

Qdrant

Databases · AI Development · Search

34,058

Open-source vector database and search engine built in Rust for production-grade AI applications — from semantic search to RAG pipelines and recommendation systems.

View details
92
Repo Health
87
Technical
69
Dependency
Built with
Rust89%
Updated yesterday
Python
97%
MPL 2.0

Taiga Back

Project Management · Developer Tools

846

Self-hosted agile project management backend with Scrum, Kanban, issue tracking, and a full REST API — built on Django and PostgreSQL.

View details
68
Repo Health
74
Technical
63
Dependency
Built with
Python97%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search