Skip to content

FlpIt

Fluent LINQ for Python — flip your iterables.

FlpIt brings the .NET LINQ query model to ordinary Python iterables, with its behaviour kept as close to System.Linq.Enumerable as Python allows. If you know C# LINQ, you already know most of FlpIt.

Queries are the doorway. Around them FlpIt carries over other parts of the .NET programming model: async streams (AsyncFlpIt), typed JSON and CSV serialization, an asyncio-free task runtime, channels and concurrent collections. It is tested on free-threaded Python (>=3.14t) in CI.

uv add flpit
from flpit import flp, FlpIt, FlpList

# A lazy, streaming pipeline: nothing has run yet.
query: FlpIt[int] = (
    flp
        .it(range(1, 11))
        .where(lambda x: x % 2 == 0)
        .select(lambda x: x * 10)
)

# Explicit materialization.
result: FlpList[int] = query.to_list()
assert result == [20, 40, 60, 80, 100]
  • Why FlpIt: the goal behind the library.
  • Guide: from the first query to joins, JSON and CSV.
  • Async queries: the same operators over async for.
  • Semantics: what behaves like LINQ, with running proof.
  • Task runtime: tasks, cancellation, channels and concurrent collections.
  • Explore .NET: where all of this comes from, and how to try it.