Skip to main content

Read simple root files into memory

Project description

ROOTLOADER

Parse simple root files into memory as dictionaries or purpose-built objects. Convert objects into pandas DataFrames for ease of processing.

Installation

Requires ROOT with pyroot installed.

Clone this repository and install

git clone git@github.com:ucn-triumf/rootloader.git
cd rootloader
pip install .

You will need to re-run the last line of the above upon every pull, unless you add the -e flag like this: pip install -e . Note that this may not work on all systems, particularly windows systems.

Documentation

See here.

Example

from rootloader import tfile

# read file
fid = tfile('myfile.root')

# key values can be accessed as attributes or as keys
# say there's a tree named "tree1". We can access it as
tr = fid.tree1

# or
tr = fid['tree1']

# get a pandas dataframe from the tree (the tree is left unaltered)
df = tr.to_dataframe()

# try to convert all file contents to pandas dataframes, and replace keys with these dataframes
fid.to_dataframe()

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

rootloader-0.5.0.tar.gz (34.2 kB view details)

Uploaded Source

File details

Details for the file rootloader-0.5.0.tar.gz.

File metadata

  • Download URL: rootloader-0.5.0.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for rootloader-0.5.0.tar.gz
Algorithm Hash digest
SHA256 43938d97e51d2ad467dca0fc6a14d0d97630fa65d4a0c25d9069680554ccb54f
MD5 1531392878c35c1218bcb4f0ea5b7ce9
BLAKE2b-256 299c9eeb9b450f60d0f3b2e047e3fd0864a7e9b51f53babee335baab74e03d80

See more details on using hashes here.

Supported by

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