Custom parsing extensions for lazy polars
Overview
polars-io-tools extends Polars lazy execution with custom I/O
sources that push filters and column projections all the way down into the systems
that hold your data — SQL databases, ClickHouse, Datadog, and Delta Lake — instead of
loading everything and filtering in memory. It also adds lazy-friendly operations
(joins, multi-source composition, time-series windows, caching, distributed execution)
that keep predicate pushdown working where vanilla Polars would otherwise give up and
materialize the whole frame.
Everything is exposed through the piot LazyFrame namespace and a handful of
top-level scan_* / sink_* functions, so it composes naturally with the Polars
API you already use.
Who is this for
Reach for polars-io-tools when you want Polars' lazy API over data that lives in an
external store, and you care about not fetching rows or columns you will immediately
throw away. It is most valuable for large, partitioned, or remote datasets where a
filter on a date or key column should translate into a smaller query against the
source. If your data already fits comfortably in memory or lives in local Parquet/CSV,
plain Polars is the simpler choice.
Installation
pip install polars-io-tools
polars-io-tools requires Python 3.11 or newer. See the
Installation guide
for conda and source builds.
Quickstart
Importing the package registers the piot namespace on every Polars LazyFrame:
import polars as pl
import polars_io_tools # registers the .piot namespace
left = pl.LazyFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
right = pl.LazyFrame({"x": [-1, -2, 3], "z": [7, 8, 9]})
# An inner join where the keys present on the left are pushed down as a
# filter on the right frame *before* the join runs.
result = left.piot.filtered_join(right, on="x").collect()
print(result)
# shape: (1, 3)
# ┌─────┬─────┬─────┐
# │ x ┆ y ┆ z │
# │ --- ┆ --- ┆ --- │
# │ i64 ┆ i64 ┆ i64 │
# ╞═════╪═════╪═════╡
# │ 3 ┆ 6 ┆ 9 │
# └─────┴─────┴─────┘
For a guided walkthrough, start with the Getting Started tutorial.
What's included
- Lazy I/O sources with predicate & projection pushdown —
scan_db(any ODBC database),scan_clickhouse,scan_datadog,scan_delta, andfrom_narwhals. Filters on the resultingLazyFrameare translated into the source's own query language (SQLWHERE, Datadog time ranges, Delta partition pruning) so only the matching rows and columns are fetched. - Lazy writers —
sink_deltaandsink_clickhousewrite aLazyFramedirectly to Delta Lake or ClickHouse, including streaming/chunked writes and transparent handling of types the target store cannot represent natively. - Pushdown-preserving query building —
filtered_join,filtered_join_asof,join_between,pushdown_combine,concat_named, andts_with_columnsexpress joins, multi-source composition, and rolling/lookback time-series logic without blocking the filter pushdown that those operations normally defeat. - Caching —
cachekeeps an in-memory, column- and partition-level cache for iterative work;cache_parquetmaterializes date-partitioned Parquet on local disk or S3, fetching only the partitions a query needs. - Distributed execution —
execute_on_raysplits aLazyFrameacross an existing Ray cluster, one task per partition. Build partitions withby_time(calendar windows),by_value(discrete keys),by_range(numeric buckets),by_key(enumerated keys), or an explicitReadPartitionlist. (For multi-stage distributed pipelines, Polars Cloud is the more strategic option.) - Ergonomics —
iter_rowsfor memory-efficient row iteration,debugto inspect what Polars pushes into a source, anddisable_optimizationsto compare against plain Polars.
Documentation
Full documentation lives in the project wiki:
- Getting Started — a guided tutorial.
- Reading and Writing Data — recipes for each I/O source and sink.
- Query Optimization — joins, composition, time-series, and caching.
- Distributed Execution — running on Ray.
- API Reference — the public functions and
piotnamespace. - Concepts — how predicate pushdown into custom sources works.
Contributing
Contributions are welcome. See the Contributing guide and Local Development Setup to get started.
License
polars-io-tools is licensed under the Apache 2.0 license.
Metadata
Release files for polars-io-tools 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polars_io_tools-0.2.6.tar.gz | 479.6 kB | Without provenance | Details for polars_io_tools-0.2.6.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| polars_io_tools-0.2.6-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for polars_io_tools-0.2.6-cp311-abi3-win_amd64.whl |
| polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ x86-64 | Details for polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_x86_64.whl |
| polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ ARM64 | Details for polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_aarch64.whl |
| polars_io_tools-0.2.6-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for polars_io_tools-0.2.6-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 3.3 MB
Release files / polars_io_tools-0.2.6.tar.gz
| Download URL | polars_io_tools-0.2.6.tar.gz |
|---|---|
| Size | 479.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dd6bf8ab4ae4c0670278dcdef28b70119444282dece750e781817d34015b6cb
|
|
BLAKE2b-256 checksum How to use checksums |
2288bfcc20dd4372b584f4ba61492bbb930c13a828a44ddedff111de04e054cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / polars_io_tools-0.2.6-cp311-abi3-win_amd64.whl
| Download URL | polars_io_tools-0.2.6-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 627.1 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7c590c90199678aded78735e2584034ed734be951b24e4acc2f75f79d87c363b
|
|
BLAKE2b-256 checksum How to use checksums |
d17c158347f263c2c1155575427f0ebb8f8703a2612b7a5548a2c4adffada648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 738.5 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3bf881bcd83481328e58247e9f82c25e709a016b66e5923c7654a6594acc7081
|
|
BLAKE2b-256 checksum How to use checksums |
d79737077b2aaf6147bf4827cb9c410b1829b283fffe59a4c4b41b85496b7db9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_aarch64.whl
| Download URL | polars_io_tools-0.2.6-cp311-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 737.8 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f8f52a7ab22d9d8738b8f51f7213ecfd98f8f23d0730e1087c43d802e78f17df
|
|
BLAKE2b-256 checksum How to use checksums |
8c5d4c86ea9d0fc6e166c2196367cbc46c27d8c82d3e301688b4627891c33300
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / polars_io_tools-0.2.6-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | polars_io_tools-0.2.6-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 719.3 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3f291623ba56123c76b90d4dc8eeae35a98c6a0240f6d3f603659e2879d11887
|
|
BLAKE2b-256 checksum How to use checksums |
9d2780987b6fba68f9f843001a5626c748375fd05cd55c0f0c83fa41f38e20f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for polars-io-tools 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.