itertools

Extra iterator adaptors, methods, and macros extending Rust's standard Iterator trait

Library
Cargo
v0.15.0
3,156stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity44
Maintenance20
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality84
Innovation72
Learning Curve78

itertools extends Rust’s standard Iterator trait with dozens of additional adaptors, free functions, and macros that the standard library deliberately leaves out — grouping, chunking, Cartesian products, deduplication, multi-way merging, permutations, and more. It’s implemented almost entirely as an extension trait (Itertools) that’s automatically available on any existing iterator once imported, so it composes with std’s own adaptors rather than replacing them.

As one of the most-downloaded crates in the Rust ecosystem (over a billion downloads), it functions as an unofficial-but-standard extension to std::iter, filling gaps that show up constantly in real code — the kind of iterator operations found in Python’s itertools module or functional-language standard libraries but historically absent from Rust’s core.

What You Get

  • The Itertools extension trait adding 100+ methods to any existing Iterator implementation
  • Grouping and chunking adaptors (.group_by(), .chunks(), .tuples()) for structuring sequential data
  • Combinatorial adaptors (.permutations(), .combinations(), .cartesian_product(), .powerset())
  • Deduplication and set-like operations (.unique(), .unique_by(), .duplicates())
  • Macros like izip! and chain! for ergonomic multi-iterator zipping and chaining

Common Use Cases

  • Deduplicating or sorting a stream of values inline within an iterator chain instead of collecting into an intermediate Vec first
  • Generating combinations, permutations, or Cartesian products for combinatorial or test-data-generation code
  • Grouping consecutive elements by a key (.group_by()) when processing sorted or structured sequential data
  • Zipping more than two iterators together ergonomically via the izip! macro instead of nested .zip() calls

Under The Hood

Architecture Roughly 15,600 lines are organized as one implementation file per adaptor or family of related methods (combinations.rs, groupbylazy.rs, intersperse.rs, duplicates_impl.rs, etc.) under src/, with src/adaptors/ holding the lower-level lazy-iterator plumbing each adaptor is built from, and lib.rs assembling everything into the single public Itertools trait — a structure that mirrors the standard library’s own core::iter module organization for familiarity. Tech Stack The crate has effectively zero required dependencies beyond std (with either as an optional lightweight dependency for a couple of adaptors), which matters given how deep in the dependency graph it sits — over a billion downloads means minimizing its own footprint has outsized ecosystem impact. Code Quality tests/ includes a dedicated laziness.rs suite verifying that adaptors don’t eagerly evaluate more of the underlying iterator than necessary (a correctness property specific to iterator libraries), plus specializations.rs testing that performance-optimization overrides (like size_hint) stay behaviorally consistent with the default implementations. API Design Nearly every addition is a method on the Itertools trait rather than a free function, so it chains directly into existing .iter().map().filter() pipelines with one import — deliberately matching std::iter’s own method-chaining idiom rather than introducing a different mental model for the 100+ additional operations it provides.

Used by 17 apps in this directory

Rust
64%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,420

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
72
Dependency
Built with
Rust64%
Go24%
Updated yesterday
Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
Rust
41%
Other

Hook0

Devops

1,477

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
70
Dependency
Built with
TypeScript69%
Rust29%
Updated yesterday
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago
Rust
72%
MIT

monty

AI Development · Developer Tools

8,079

Run LLM-generated Python code safely inside your agent—no containers, no CPython, no compromise—with sub-microsecond startup.

View details
87
Repo Health
83
Technical
73
Dependency
Built with
Rust72%
Python23%
Updated yesterday
Rust
91%
Apache 2.0

Murr

Databases

107

A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.

View details
63
Repo Health
72
Technical
75
Dependency
Built with
Rust91%
Updated 1 months 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