Python implementation of LINQ to Objects — fluent, lazy, and fully typed
Project description
zlinq
Python reimplementation of LINQ to Objects — lazy, chainable, fully typed query operators for iterables.
Install
uv add zlinq
or
pip install zlinq
Quick example
from zlinq import Enumerable
result = (Enumerable([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
.where(lambda x: x % 2 == 0)
.select(lambda x: x * 10)
.take(3)
.to_list())
# [20, 40, 60]
Operators
All operators are available both as Enumerable methods (method chaining) and as standalone functions imported directly from zlinq.
| Category | Operators |
|---|---|
| Generation | empty, range, repeat |
| Filtering | where, of_type |
| Projection | select, select_many |
| Partitioning | take, skip, take_while, skip_while, chunk |
| Element | first / first_or_default, last / last_or_default, single / single_or_default, element_at / element_at_or_default, default_if_empty |
| Aggregation | count, sum, min, max, average, aggregate, scan, min_by, max_by |
| Quantifiers | any, all, contains |
| Set | distinct, distinct_by, union, union_by, intersect, intersect_by, except_, except_by |
| Ordering | order_by, order_by_descending, then_by, then_by_descending, reverse |
| Grouping | group_by, to_lookup |
| Joining | join, group_join |
| Concatenation | concat, append, prepend |
| Zip | zip |
| Conversion | to_list, to_dictionary, to_hash_set, to_lookup, as_enumerable |
| Equality | sequence_equal |
Documentation
Full API reference and usage guides are available at the MkDocs site (run mkdocs serve locally).
License
Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zlinq-0.1.0.tar.gz.
File metadata
- Download URL: zlinq-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf3619f74a50ea29d10f86a251448447305d23282abf69dd5df40354cf908be0
|
|
| MD5 |
f65b5e75bec682cab75f5b9ffe89228e
|
|
| BLAKE2b-256 |
57dfdfe0461afaefecaebf4f5cacad674ada1858163a7ca48715b2801a47458b
|
File details
Details for the file zlinq-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zlinq-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1446de9968a74175b3f7aefccbe55a24f222acdce2b44eeda1c258b2bce0e665
|
|
| MD5 |
8a5c873991e07a656a75a13691f353d1
|
|
| BLAKE2b-256 |
2182af87b725ef9e5664b31757aeef77656784e1f7988370a627597fbe7231dc
|