Metadata-Version: 2.4
Name: polars
Version: 2.2.0
Summary: Blazingly fast DataFrame library
Author-email: Ritchie Vink <ritchie46@gmail.com>
License: Copyright (c) 2025 Ritchie Vink
        Copyright (c) 2024 (Some portions) NVIDIA CORPORATION & AFFILIATES. All rights reserved.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://www.pola.rs/
Project-URL: Documentation, https://docs.pola.rs/api/python/stable/reference/index.html
Project-URL: Repository, https://github.com/pola-rs/polars
Project-URL: Changelog, https://github.com/pola-rs/polars/releases
Keywords: dataframe,arrow,out-of-core
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: polars-runtime-32==2.2.0
Provides-Extra: rt64
Requires-Dist: polars-runtime-64==2.2.0; extra == "rt64"
Provides-Extra: rtcompat
Requires-Dist: polars-runtime-compat==2.2.0; extra == "rtcompat"
Provides-Extra: polars-cloud
Requires-Dist: polars_cloud>=0.13.0; extra == "polars-cloud"
Provides-Extra: polars-nanook
Requires-Dist: polars_nanook>=0.13.0; extra == "polars-nanook"
Provides-Extra: numpy
Requires-Dist: numpy>=1.16.0; extra == "numpy"
Provides-Extra: pandas
Requires-Dist: pandas; extra == "pandas"
Requires-Dist: polars[pyarrow]; extra == "pandas"
Provides-Extra: pyarrow
Requires-Dist: pyarrow>=7.0.0; extra == "pyarrow"
Provides-Extra: pydantic
Requires-Dist: pydantic; extra == "pydantic"
Provides-Extra: calamine
Requires-Dist: fastexcel>=0.9; extra == "calamine"
Provides-Extra: openpyxl
Requires-Dist: openpyxl>=3.0.0; extra == "openpyxl"
Provides-Extra: xlsx2csv
Requires-Dist: xlsx2csv>=0.8.0; extra == "xlsx2csv"
Provides-Extra: xlsxwriter
Requires-Dist: xlsxwriter; extra == "xlsxwriter"
Provides-Extra: excel
Requires-Dist: polars[calamine,openpyxl,xlsx2csv,xlsxwriter]; extra == "excel"
Provides-Extra: adbc
Requires-Dist: adbc-driver-manager[dbapi]; extra == "adbc"
Requires-Dist: adbc-driver-sqlite[dbapi]; extra == "adbc"
Provides-Extra: connectorx
Requires-Dist: connectorx>=0.3.2; extra == "connectorx"
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy; extra == "sqlalchemy"
Requires-Dist: polars[pandas]; extra == "sqlalchemy"
Provides-Extra: database
Requires-Dist: polars[adbc,connectorx,sqlalchemy]; extra == "database"
Requires-Dist: connectorx>=0.4.6; extra == "database"
Requires-Dist: sqlalchemy>=2.0; extra == "database"
Requires-Dist: polars-database<1.0.0,>=0.1.2; extra == "database"
Provides-Extra: fsspec
Requires-Dist: fsspec; extra == "fsspec"
Provides-Extra: deltalake
Requires-Dist: deltalake!=1.5.*,>=1.2.0; extra == "deltalake"
Provides-Extra: iceberg
Requires-Dist: pyiceberg>=0.12.0; extra == "iceberg"
Requires-Dist: polars-iceberg<1.0.0,>=0.1.1; extra == "iceberg"
Provides-Extra: async
Requires-Dist: gevent; extra == "async"
Provides-Extra: cloudpickle
Requires-Dist: cloudpickle; extra == "cloudpickle"
Provides-Extra: graph
Requires-Dist: matplotlib; extra == "graph"
Provides-Extra: plot
Requires-Dist: altair>=5.4.0; extra == "plot"
Provides-Extra: style
Requires-Dist: great-tables>=0.8.0; extra == "style"
Provides-Extra: timezone
Requires-Dist: tzdata; platform_system == "Windows" and extra == "timezone"
Provides-Extra: gpu
Requires-Dist: cudf-polars-cu12; extra == "gpu"
Provides-Extra: all
Requires-Dist: polars[async,cloudpickle,database,deltalake,excel,fsspec,graph,iceberg,numpy,pandas,plot,pyarrow,pydantic,style,timezone]; extra == "all"
Dynamic: license-file

<h1 align="center">
  <a href="https://pola.rs">
    <img src="https://raw.githubusercontent.com/pola-rs/polars-static/master/banner/polars_github_banner.svg" alt="Polars logo">
  </a>
</h1>

<div align="center">
  <a href="https://crates.io/crates/polars">
    <img src="https://img.shields.io/crates/v/polars.svg" alt="crates.io Latest Release"/>
  </a>
  <a href="https://pypi.org/project/polars/">
    <img src="https://img.shields.io/pypi/v/polars.svg" alt="PyPi Latest Release"/>
  </a>
  <a href="https://www.npmjs.com/package/nodejs-polars">
    <img src="https://img.shields.io/npm/v/nodejs-polars.svg" alt="NPM Latest Release"/>
  </a>
  <a href="https://community.r-multiverse.org/polars">
    <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fcommunity.r-multiverse.org%2Fapi%2Fpackages%2Fpolars&query=%24.Version&label=r-multiverse" alt="R-multiverse Latest Release"/>
  </a>
  <a href="https://doi.org/10.5281/zenodo.7697217">
    <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.7697217.svg" alt="DOI Latest Release"/>
  </a>
</div>

<p align="center">
  <b>Documentation</b>:
  <a href="https://docs.pola.rs/api/python/stable/reference/index.html">Python</a>
  -
  <a href="https://docs.rs/polars/latest/polars/">Rust</a>
  -
  <a href="https://pola-rs.github.io/nodejs-polars/index.html">Node.js</a>
  -
  <a href="https://pola-rs.github.io/r-polars/index.html">R</a>
  -
  <a href="https://docs.pola.rs/api/python/stable/reference/sql/index.html">SQL</a>
  |
  <b>Agents</b>:
  <a href="https://github.com/polars-inc/skills/tree/main/polars">Skill</a>
  -
  <a href="https://docs.pola.rs/user-guide/misc/polars_llms/">MCP</a>
  |
  <a href="https://docs.pola.rs/">User guide</a>
  |
  <a href="https://discord.gg/4UfP5cfBE7">Discord</a>
</p>

## 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

<details>
<summary><b>Compile Polars from source</b></summary>

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

</details>

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