more-itertools

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

Library
PyPI
v11.1.0
4,096 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
87 /100 Excellent
Development Activity 100
Maintenance 84
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 78
Code Quality 85
Innovation 70
Learning Curve 75

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 7 apps in this directory

Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

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
64
Dependency
Built with
Python 89%
Updated 4 days ago
C++
68%
Apache 2.0

ClickHouse

Analytics · Data Engineering · Databases

50,116

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
64
Dependency
Built with
C++ 68%
Python 14%
Updated 4 days ago
Go
67%
Apache 2.0

OSV.dev

Security

2,948

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
87
Repo Health
82
Technical
66
Dependency
Built with
Go 67%
Python 22%
Updated 4 days ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

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
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 4 days ago
Rust
90%
Apache 2.0

Qdrant

AI Development · Databases · Search

34,857

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
65
Dependency
Built with
Rust 90%
Updated 5 days ago
Python
97%
MPL 2.0

Taiga Back

Developer Tools · Project Management

854

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

View details
76
Repo Health
74
Technical
64
Dependency
Built with
Python 97%
Updated 1 weeks ago
Python
95%
AGPL 3.0

VideoHighlighter

Video Editors

138

Local AI desktop tool that scores, explains, and cuts the moments that matter in raw footage — scene, motion, audio, object, and action detection, fully offline via Ollama and Whisper.

View details
80
Repo Health
84
Technical
71
Dependency
Built with
Python 95%
Updated 5 days 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