https://github.com/pola-rs/polars
Extremely fast Query Engine for DataFrames, written in Rust
https://github.com/pola-rs/polars
arrow dataframe dataframe-library dataframes out-of-core polars python rust
Last synced: 8 days ago
JSON representation
Extremely fast Query Engine for DataFrames, written in Rust
- Host: GitHub
- URL: https://github.com/pola-rs/polars
- Owner: pola-rs
- License: mit
- Created: 2020-05-13T19:45:33.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2026-11-16T18:39:12.000Z (10 days ago)
- Last Synced: 2026-11-16T19:24:45.675Z (10 days ago)
- Topics: arrow, dataframe, dataframe-library, dataframes, out-of-core, polars, python, rust
- Language: Rust
- Homepage: https://docs.pola.rs
- Size: 229 MB
- Stars: 40,350
- Watchers: 214
- Forks: 3,242
- Open Issues: 2,940
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-skill - polars - ⭐ 39,271 - Extremely fast Query Engine for DataFrames, written in Rust (Skills (202 total) / Data & Automation)
- awesome-python-data-science - polars - A fast multi-threaded, hybrid-out-of-core DataFrame library. (Data Manipulation / Data Frames)
- awesome-rust - pola-rs/polars - Fast feature complete DataFrame library  (Libraries / Data processing)
- awesome-rust-cn - pola-rs/polars - (库 Libraries / 数据处理 Data processing)
- awesome-list - Polars - Fast multi-threaded DataFrame library in Rust, Python and Node.js. (Data Processing / Data Representation)
- awesome-data-analysis - Polars - Multithreaded, vectorized query engine for DataFrames. (🐍 Python / Useful Python Tools for Data Analysis)
- awesomeLibrary - polars - Fast multi-threaded, hybrid-out-of-core query engine focussing on DataFrame front-ends (语言资源库 / rust)
- fucking-awesome-python - polars - A fast DataFrame library implemented in Rust with a Python API. (Projects / Data Analysis)
- awesome-opensource-ai - Polars - Blazing-fast DataFrame library (Rust backend) - modern alternative to Pandas for large-scale workloads.  (1. Core Frameworks & Libraries)
- awesome-rust - pola-rs/polars - Fast feature complete DataFrame library [](https://github.com/pola-rs/polars/actions) (Libraries / Data processing)
- awesome-rust - pola-rs/polars - Fast feature complete DataFrame library  (Libraries / Data processing)
- awesome-rust-list - Polars - rs/polars?style=social"/> : [Polars](https://www.pola.rs/). Fast multi-threaded, hybrid-out-of-core DataFrame library in Rust | Python | Node.js. (Scientific Computation)
- awesome-rust-ai-libraries - Polars - High-performance DataFrame library in Rust, serving as a faster alternative to pandas for data manipulation in AI workflows. ([Read more](/details/polars.md)) `Open Source` `Dataframe` `High Performance` (Data Processing)
- awesome-pypi-packages - Polars - DataFrame library optimized for performance. (Data Science)
- AiTreasureBox - pola-rs/polars - 11-03_35914_1](https://img.shields.io/github/stars/pola-rs/polars.svg)|Fast multi-threaded, hybrid-out-of-core query engine focussing on DataFrame front-ends| (Repos)
- awesome-ml-python-packages - polars
- awesome-starred - pola-rs/polars - Dataframes powered by a multithreaded, vectorized query engine, written in Rust (rust)
- awesome-python-fa - polars - کتابخانه سریع پردازش داده مبتنی بر Rust. (📚 فهرست / کتابخانه هاي تحليل داده)
- awesome-ccamel - pola-rs/polars - Extremely fast Query Engine for DataFrames, written in Rust (Rust)
- awesome-rust-python - polars - DataFrame library with a Pandas-like API. (Data Processing)
- awesome-github-projects - polars - Extremely fast Query Engine for DataFrames, written in Rust ⭐40,379 `Rust` 🔥 (⚙️ Backend & APIs)
- awesome-dataframes - Polars - Fast multi-threaded DataFrame library in Rust and Python. (Libraries)
- awesome-systematic-trading - Polars -  | Rust, Python | - Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow Columnar Format as memory model. (Basic Components / Fundamental libraries)
- awesome-software-gamechanger-stack - polars - core](https://github.com/pydantic/pydantic-core), [cryptography](https://github.com/pyca/cryptography). (Python Toolchain / [Maturin](https://github.com/PyO3/maturin) `Rust` `4K ` · [docs](https://www.maturin.rs/))
- awesome-rust-with-stars - pola-rs/polars - 01-30 | (Libraries / Data processing)
- awesome-ai-agent-stack - pola-rs/polars - Blazing-fast DataFrame library for Python and Rust. (Data, Datasets & Synthetic Data)
- awesome-python - polars - A fast DataFrame library implemented in Rust with a Python API. (Data Analysis)
- awesome-parquet - Polars - A DataFrame interface on top of an OLAP Query Engine that supports reading and writing Parquet files, with bindings for Python. (Libraries / Rust)
- github-ultimate-repos - pola-rs/polars - | ⭐ 40,190★ | 🍴 3,205 | 💻 `Rust`🔗 <https://github.com/pola-rs/polars>📝 Extremely fast Query Engine for DataFrames, written in Rust⚙️ `CPython C-API binding -> vectorized NumPy ndarray broadcasting -> SIMD/BLAS numerical linear algebra -> computational pipeline execution -> serialized analytical output.` (📜 Master Categorized Repository Directory (100% Clickable Links) / [55] PYTHON ECOSYSTEM, DATA SCIENCE, SCIENTIFIC COMPUTING & ANALYTICS)
- awesome-datascience - Polars
- fucking-awesome-datascience - Polars - Fast DataFrame library for Rust and Python, designed as a faster alternative to Pandas (The Data Science Toolbox / Miscellaneous Tools)
- awesome-etl - polars - "Extremely fast Query Engine for DataFrames, written in Rust." (Python / Libraries)
- awesome-python-rs - polars - DataFrame library with lazy evaluation and parallel execution. (Data Processing & DataFrames)
- awesome-AI-books - Polars - (**Rust, Python**) - Lightning-fast DataFrame library for Rust and Python. (Libs With Online Books)
- awesome-python-data-science - polars - A fast multi-threaded, hybrid-out-of-core DataFrame library. (Data Manipulation / Data Frames)
- fucking-awesome-rust - pola-rs/polars - Fast feature complete DataFrame library [](https://github.com/pola-rs/polars/actions) (Libraries / Data processing)
- awesome-quant-interview - Polars - 比 pandas 快 10-50x 的数据处理库 (🧰 开源工具:回测、平台、AI + Finance、数据处理 / 金融工程、优化与数据处理库)
README
Documentation:
Python
-
Rust
-
Node.js
-
R
-
SQL
|
Agents:
Skill
-
MCP
|
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:
- **Fast**: written from the ground up in Rust with multi-threaded, vectorized (SIMD) execution
- **Spill to disk**: Operations that exceed available RAM can spill to disk
- **Expressive API**: compose complex queries with powerful expressions
- **Extensible**: extend Polars natively with custom code through
[I/O and Expression plugins](https://docs.pola.rs/user-guide/plugins/)
- **GPU support**: optionally accelerate queries on NVIDIA GPUs
- **Interoperable**: uses the
[Apache Arrow Columnar Format](https://arrow.apache.org/docs/format/Columnar.html) for zero-copy
data sharing
To learn more, read the [user guide](https://docs.pola.rs/).
## 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:
```python
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
```python
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:
```python
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](https://docs.pola.rs/user-guide/sql/intro/).
## 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](https://www.pola.rs/benchmarks.html)
results.
## Installation
### Python
Install the latest Polars version with:
```sh
pip install polars
```
See the [User Guide](https://docs.pola.rs/user-guide/installation/#feature-flags) 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](https://www.rust-lang.org/tools/install)
2. Install [maturin](https://maturin.rs/): `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](https://docs.pola.rs/user-guide/installation/) 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](https://docs.pola.rs/development/contributing/)
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](https://discord.gg/4UfP5cfBE7) 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](https://docs.nanook.pola.rs/).
## License
Polars is licensed under the [MIT License](LICENSE) (SPDX: `MIT`).