Extremely fast Query Engine for DataFrames, written in Rust https://docs.pola.rs
  • Rust 62.7%
  • Python 37.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-21 17:36:55 +02:00
.cargo chore: Add min-publish-age for cargo (#28906) 2026-08-22 13:38:14 +02:00
.github refactor(rust): Add polars-defs crate to hold common definitions between plan/execution (#29307) 2026-09-16 14:37:42 +02:00
crates perf: Narrow the decimal rescale to 64 bits when the value fits (#29396) 2026-09-21 17:36:55 +02:00
docs docs: Update migration guide with rc2 changes (#29415) 2026-09-21 15:59:38 +02:00
examples/datasets fix: Fix SQL subquery qualified lowering and cache row-index (#28926) 2026-08-23 15:49:42 +02:00
py-polars fix: Fix over ordering for multiple cols (#29417) 2026-09-21 16:21:46 +02:00
pyo3-polars perf: Coerce float literals to decimal instead of casting the column (#29395) 2026-09-20 14:29:57 +02:00
tools chore: Add min-publish-age for cargo (#28906) 2026-08-22 13:38:14 +02:00
.gitattributes
.gitignore chore: Add min-publish-age for cargo (#28906) 2026-08-22 13:38:14 +02:00
.typos.toml feat: Add adaptive HTTP rate-limiter for cloud IO (#28591) 2026-08-05 10:58:37 +02:00
AI_POLICY.md chore: Update AI policy for comments (#28436) 2026-07-20 12:48:10 +02:00
Cargo.lock release(python): Polars 2.0.0rc2 (#29355) 2026-09-20 11:38:43 +02:00
Cargo.toml refactor(rust): Rename arrow(-format) to polars-arrow(-format) (#29356) 2026-09-17 16:15:19 +02:00
CONTRIBUTING.md docs: Change dprint config (#19747) 2024-11-16 15:43:06 +01:00
deny.toml chore: Bump object_store crate to 0.14.2 (#29317) 2026-09-15 20:25:27 +02:00
dprint.json refactor: Store more granular schema hashes to reduce merge conflicts (#23709) 2025-07-24 15:25:03 +02:00
flake.lock chore: Make nix flake mostly work (#26517) 2026-02-11 08:26:41 +01:00
flake.nix refactor(rust): Add polars-defs crate to hold common definitions between plan/execution (#29307) 2026-09-16 14:37:42 +02:00
LICENSE chore: Reformat LICENSE (#26532) 2026-02-12 12:01:53 +01:00
Makefile feat(python): Support incremental append Iceberg scans (#28820) 2026-09-07 16:47:28 +10:00
mkdocs.yml docs: Add user-guide for new enable_monitoring feature (#29358) 2026-09-17 16:03:50 +02:00
README.md docs: Update and restructure README (#28490) 2026-07-24 09:22:00 +02:00
rust-toolchain.toml chore: Bump rust toolchain (#29080) 2026-09-01 16:51:37 +02:00
rustfmt.toml chore: Add use_field_init_shorthand = true to rustfmt (#21237) 2025-02-13 15:38:24 +01:00
SECURITY.md docs: Fix duplicated article in SECURITY.md (#24762) 2025-10-06 09:03:27 +02:00

Polars logo

Documentation: Python - Rust - Node.js - R | Agents: Skill - MCP | User guide | Discord

Polars: Extremely fast Query Engine for DataFrames

Polars is an analytical query engine for DataFrames, written in Rust. It is designed to be fast, easy to use and expressive. Key features are:

  • Fast: written from the ground up in Rust with multi-threaded, vectorized (SIMD) execution
  • Lazy & eager execution: with query optimization out of the box
  • Larger-than-RAM: the streaming engine processes datasets that don't fit in memory
  • Expressive API: compose complex queries with powerful expressions
  • Extensible: extend Polars natively with custom code through I/O and Expression plugins
  • Multi-language: bindings for Python, Rust, Node.js, R, and SQL
  • GPU support: optionally accelerate queries on NVIDIA GPUs
  • Interoperable: uses the Apache Arrow Columnar Format for zero-copy data sharing

To learn more, read the user guide.

Polars in action

Queries are composed from expressions. This lazy query gets optimized out of the box and runs in parallel across all available cores:

import polars as pl

df = (
    pl.scan_parquet("orders.parquet")
    .filter(pl.col("status") == "shipped")
    .group_by("customer_id")
    .agg(
        pl.col("amount").sum().alias("total"),
        pl.len().alias("n_orders"),
    )
    .sort("total", descending=True)
    .collect()
)

Performance

Polars is very fast. In fact, it is one of the best performing Dataframe solutions available. See the PDS-H benchmarks results.

Handles larger-than-RAM data

If you have data that does not fit into memory, Polars' query engine is able to process your query (or parts of your query) in a streaming fashion. This drastically reduces memory requirements, so you might be able to process your 250GB dataset on your laptop. Collect with collect(engine='streaming') to run the query streaming.

Installation

Python

Install the latest Polars version with:

pip install polars

See the User Guide for more details on optional dependencies

Compile Polars from source

If you want a bleeding edge release you should compile Polars from source. Advanced users can also compile for maximum performance for their architecture.

This can be done by going through the following steps in sequence:

  1. Install the latest Rust compiler
  2. Install maturin: pip install maturin
  3. cd py-polars and choose one of the following:
    • make build, slow binary with debug assertions and limited symbols, fast compile times
    • make build-debug, same as make build, but with all symbols, produces large binaries
    • make build-release, fast binary without debug assertions, minimal debug symbols, long compile times
    • make build-nodebug-release, same as build-release but without any debug symbols, slightly faster to compile
    • make build-debug-release, same as build-release but with full debug symbols, slightly slower to compile
    • make build-dist-release, fastest binary, extreme compile times

By default the binary is compiled with optimizations turned on for a modern CPU. Specify LTS_CPU=1 with the command if your CPU is older and does not support e.g. AVX2.

Note that the Rust crate implementing the Python bindings is called py-polars to distinguish from the wrapped Rust crate polars itself. However, both the Python package and the Python module are named polars, so you can pip install polars and import polars.

Check the Installation guide for more advanced installations. For example when you expect more than 2^32 (~4.2 billion) rows, run on an old CPU (e.g. dating from before 2011), or on an x86-64 build of Python on Apple Silicon under Rosetta.

Contributing

Want to contribute? Read our contributing guide and check the issue tracker for accepted issues.

Contributors new to the codebase can look for the good first issue label to get familiar with the project.

You can join the Polars Discord server for any help along the way.

Distributed Polars

Running into hardware limitations executing your queries? Read how you can horizontally scale your Polars query on a cluster.

License

Polars is licensed under the MIT License (SPDX: MIT).