Metadata-Version: 2.4
Name: polars-root
Version: 0.1.1
Summary: Polars plugin for reading CERN's ROOT file format
Project-URL: Homepage, https://github.com/DanielMaysWilliams/polars-root
Author-email: Daniel Williams <daniel.mays.williams@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Daniel Williams
        
        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.
License-File: LICENSE
Keywords: dataframe,polars,root
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Requires-Dist: awkward>=2
Requires-Dist: awkward>=2.7; python_version >= '3.13'
Requires-Dist: pyarrow>=15
Requires-Dist: pyarrow>=18; python_version >= '3.13'
Requires-Dist: uproot>=5.4
Provides-Extra: standard
Requires-Dist: polars>=1.22; extra == 'standard'
Provides-Extra: u64-idx
Requires-Dist: polars-u64-idx>=1.22; extra == 'u64-idx'
Description-Content-Type: text/markdown

# Polars ROOT #

[Polars](https://pola.rs/) plugin for reading [CERN's ROOT file format](https://root.cern/).
Uses [Uproot](https://github.com/scikit-hep/uproot5) and [Awkward Arrays](https://github.com/scikit-hep/awkward) under the hood.

## Installation ##

`polars-root` supports Python 3.10 and later.
To install for use with standard `polars`, run:

```bash
pip install 'polars-root[standard]'
```

To install for use with `polars-u64-idx`, run:

```bash
pip install 'polars-root[u64-idx]'
```

## Usage ##
```python
import polars as pl
import polars_root as pr

# Read TTree `tree_name` from a ROOT file into a Polars DataFrame
df = pr.read_root("example.root", "tree_name")

# Read TTree `tree_name` from a ROOT file into a Polars LazyFrame
lf = pr.scan_root("example.root", "tree_name")

# Load TTree `tree_name` from a ROOT file into a LazyFrame, perform some operations, and then sink to parquet
(
    pr.scan_root("example.root", "tree_name")
    .filter(pl.col("some_column") > 0)
    .select(["some_column", "another_column"])
    .sink_parquet("output.parquet")
)

# Also supports opening a ROOT file and jumping straight to a TTree using a colon, as in Uproot:
df = pr.read_root("example.root:tree_name")
```
