pola-rs/polars

▲ 31 stars today★ 40,520⑂ 3,268

Extremely fast Query Engine for DataFrames, written in Rust

About pola-rs/polars

pola-rs/polars is an open-source project on GitHub, mainly written in Rust. Extremely fast Query Engine for DataFrames, written in Rust It currently holds 40,520 stars and 3,268 forks with 2,855 open issues, and was last pushed on 2026-11-26 (repository created 2020-05-13).

Project Overview

Git Homed tracks it on the Today's Trending board, currently at rank #88 with 31 new stars today.

GitHub Repository Details

Repository pola-rs/polars · default branch main · size 243337 KB · watchers 215 · source: GitHub REST API and repository README

README

https://github.com/pola-rs/polars/blob/HEAD/Polars logo

https://github.com/pola-rs/polars/blob/HEAD/crates.io Latest Release https://github.com/pola-rs/polars/blob/HEAD/PyPi Latest Release https://github.com/pola-rs/polars/blob/HEAD/NPM Latest Release https://github.com/pola-rs/polars/blob/HEAD/R-multiverse Latest Release https://github.com/pola-rs/polars/blob/HEAD/DOI Latest Release

Documentation: Python

| Agents: Skill | User guide | Discord

Polars: Extremely fast Query Engine for DataFrames and SQL

Polars is an analytical query engine written in Rust. Write your queries with the DataFrame API, in SQL, or mix both: they run through the same optimizer and the same engine. It is designed to be fast, easy to use and expressive. Key features are:

I/O and Expression plugins Apache Arrow Columnar Format for zero-copy data sharing

To learn more, read the user guide.

Polars in action

DataFrame API

Queries are composed from expressions or SQL. 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() )

SQL

import polars as pl

df = pl.sql(""" WITH totals AS ( SELECT customer_id, SUM(amount) AS total, COUNT(*) AS n_orders FROM read_parquet('orders.parquet') WHERE status = 'shipped' GROUP BY customer_id ) SELECT c.name, t.total, t.n_orders, RANK() OVER (ORDER BY t.total DESC) AS rank FROM totals t JOIN read_parquet('customers.parquet') c USING (customer_id) ORDER BY t.total DESC """).collect()

Mix both

DataFrames and LazyFrames in scope can be queried by name, and the result of a SQL query is a regular LazyFrame, so you can switch between SQL and expressions freely:

orders = pl.scan_parquet("orders.parquet")

df = ( pl.sql("SELECT customer_id, SUM(amount) AS total FROM orders GROUP BY customer_id") .filter(pl.col("total") > 1_000) .collect() )

Read more in the SQL user guide.

Performance

Polars is very fast. In fact, it is one of the best performing query engines available, for both DataFrame and SQL workloads. See the PDS-H benchmarks results.

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).

GitHub Stars & Activity

40,520Stars
3,268Forks
2,855Open issues
RustLanguage

GitHub Popularity

GitHub stars40,520
Forks3,268
Open issues2,855
Primary languageRust
LicenseMIT
Stars gained today31
Created2020-05-13
Last pushed2026-11-26

Trending History

Daily boardrank #88 · ▲ 31 stars

Related GitHub Projects

1

rustdesk / rustdesk

Rust★ 132,946⑂ 21,630▲ 297 stars
→
2

rtk-ai / rtk

Rust★ 88,642⑂ 5,721▲ 136 stars
→
3

janhq / jan

Rust★ 46,356⑂ 3,313▲ 29 stars
→
4

lbjlaq / Antigravity-Manager

Rust★ 34,825⑂ 3,649▲ 97 stars
→
5

t8y2 / dbx

Rust★ 32,307⑂ 2,962▲ 130 stars
→
6

perspective-dev / perspective

Rust★ 11,984⑂ 1,393▲ 29 stars
→
7

oxc-project / tsrs

Rust★ 3,562⑂ 90▲ 38 stars
→
8

mattpocock / skills

Shell★ 338,218⑂ 28,530▲ 778 stars
→

More Trending Repositories