polars-root


Namepolars-root JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryPolars plugin for reading CERN's ROOT file format
upload_time2025-07-30 13:39:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT 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.
keywords dataframe polars root
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "polars-root",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "dataframe, polars, root",
    "author": null,
    "author_email": "Daniel Williams <daniel.mays.williams@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/46/13/77e1fd8df5b7d84a92c2a128f46ec7649b7b7c7087225d3ac581bf967fa9/polars_root-0.1.1.tar.gz",
    "platform": null,
    "description": "# Polars ROOT #\n\n[Polars](https://pola.rs/) plugin for reading [CERN's ROOT file format](https://root.cern/).\nUses [Uproot](https://github.com/scikit-hep/uproot5) and [Awkward Arrays](https://github.com/scikit-hep/awkward) under the hood.\n\n## Installation ##\n\n`polars-root` supports Python 3.10 and later.\nTo install for use with standard `polars`, run:\n\n```bash\npip install 'polars-root[standard]'\n```\n\nTo install for use with `polars-u64-idx`, run:\n\n```bash\npip install 'polars-root[u64-idx]'\n```\n\n## Usage ##\n```python\nimport polars as pl\nimport polars_root as pr\n\n# Read TTree `tree_name` from a ROOT file into a Polars DataFrame\ndf = pr.read_root(\"example.root\", \"tree_name\")\n\n# Read TTree `tree_name` from a ROOT file into a Polars LazyFrame\nlf = pr.scan_root(\"example.root\", \"tree_name\")\n\n# Load TTree `tree_name` from a ROOT file into a LazyFrame, perform some operations, and then sink to parquet\n(\n    pr.scan_root(\"example.root\", \"tree_name\")\n    .filter(pl.col(\"some_column\") > 0)\n    .select([\"some_column\", \"another_column\"])\n    .sink_parquet(\"output.parquet\")\n)\n\n# Also supports opening a ROOT file and jumping straight to a TTree using a colon, as in Uproot:\ndf = pr.read_root(\"example.root:tree_name\")\n```\n",
    "bugtrack_url": null,
    "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.",
    "summary": "Polars plugin for reading CERN's ROOT file format",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/DanielMaysWilliams/polars-root"
    },
    "split_keywords": [
        "dataframe",
        " polars",
        " root"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d3ef256d467a92b33da4af2d4cb0575ffe5c24a7f69be709e0a67a27d3e62a77",
                "md5": "32c0213720f05065fb1e9a0f750e127c",
                "sha256": "9b9219beedc0ea1987c60837e9df22418b46a0656340d09e0720a1483da3a714"
            },
            "downloads": -1,
            "filename": "polars_root-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "32c0213720f05065fb1e9a0f750e127c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 4325,
            "upload_time": "2025-07-30T13:39:28",
            "upload_time_iso_8601": "2025-07-30T13:39:28.953125Z",
            "url": "https://files.pythonhosted.org/packages/d3/ef/256d467a92b33da4af2d4cb0575ffe5c24a7f69be709e0a67a27d3e62a77/polars_root-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "461377e1fd8df5b7d84a92c2a128f46ec7649b7b7c7087225d3ac581bf967fa9",
                "md5": "576168c7981ae33defcb1892ea7b6cd5",
                "sha256": "0ff6e2f4962c6507991ddbed171b5769e7869d222528f53684232bd50f35095d"
            },
            "downloads": -1,
            "filename": "polars_root-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "576168c7981ae33defcb1892ea7b6cd5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 59141,
            "upload_time": "2025-07-30T13:39:29",
            "upload_time_iso_8601": "2025-07-30T13:39:29.728317Z",
            "url": "https://files.pythonhosted.org/packages/46/13/77e1fd8df5b7d84a92c2a128f46ec7649b7b7c7087225d3ac581bf967fa9/polars_root-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 13:39:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DanielMaysWilliams",
    "github_project": "polars-root",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "polars-root"
}
        
Elapsed time: 1.24922s