Skip to main content

Polars plugin for reading ROOT files

Project description

Polars ROOT

Polars plugin for reading ROOT files. Uses Uproot and Awkward Arrays under the hood.

Installation

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

pip install 'polars-root[standard]'

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

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

Usage

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_root-0.1.0.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polars_root-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file polars_root-0.1.0.tar.gz.

File metadata

  • Download URL: polars_root-0.1.0.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for polars_root-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f771e756223f02fd0a022fe7da5a37ca2dd74b0e0a94a782e6a6912f8a51acd8
MD5 2db274a1e7ae59f6505e2f8fb078586e
BLAKE2b-256 20f25780d42f3c88f9456f31d7cc8d4528a1a8d26c1d4af0a974e4f88b40c428

See more details on using hashes here.

File details

Details for the file polars_root-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for polars_root-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7729674d603b56a9267cc19dcbc6b43a911c73351083b826df7b911fe1f63af4
MD5 34ea59a5adf20f1a67a1f901c3fd10ce
BLAKE2b-256 5688ba4d63f7b7267894988ec21ff1af2cdea701476c3b87ace025264bb59654

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page