Skip to main content

Tools to inspect ROOT files with uproot

Project description

uproot-browser

Actions Status Documentation Status Code style: black

PyPI version Conda-Forge PyPI platforms

GitHub Discussion Gitter Scikit-HEP

uproot-browser is a plotext based command line library. Its aim is to enable a user to browse and look inside a ROOT file, completely via the terminal. It takes its inspiration from the ROOT object browser.

Installation

You can install this library from PyPI with pip:

python3 -m pip install uproot-browser

You can also use pipx to run the library without installing it:

pipx run uproot-browser

Features

uproot-browser currently provides the following features:

  • plot can be used to display a plot.
  • tree can be used to display a tree.

Usage

-h or --help option:

uproot-browser -h

The help page is also shown if no argument or command is passed.

Usage: uproot-browser [OPTIONS] COMMAND [ARGS]...

  Must provide a subcommand.

Options:
  -h, --help  Show this message and exit.

Commands:
  plot  Display a plot.
  tree  Display a tree.

Example

This example uses data from the scikit-hep-testdata package. It is placed in the same directory as the uproot-browser repository.

plot command:

uproot-browser plot ../scikit-hep-testdata/src/skhep_testdata/data/uproot-issue213.root:gen_hits_z_pos
    ┌─────────────────────────────────────────────────────┐
21.0┤                                                                                                            17.5┤                                                                                                            14.0┤                                                                                                            10.5┤                                                                                                                                                                     7.0┤                                                                                                             3.5┤                                                                                                             0.0┤                      ▐█▌                              └┬────────────┬────────────┬────────────┬────────────┬┘
     -59.9      -29.9         0.0         29.9        59.9

tree command:

uproot-browser tree ../scikit-hep-testdata/src/skhep_testdata/data/uproot-issue213.root
📁 uproot-issue213.root
┣━━ 🌴 T (100)   ┣━━ 🍁 eventPack JPetGeantEventPack
┃   ┣━━ 🍁 TObject (group of fUniqueID:uint32_t,
┃      fBits:uint8_t)   ┣━━ 🍁 fUniqueID uint32_t
┃   ┣━━ 🍁 fBits uint8_t
┃   ┣━━ 🍁 fMCHits int32_t
┃   ┣━━ 🍃 fMCHits.fUniqueID uint32_t[]   ┣━━ 🍃 fMCHits.fBits uint8_t[]   ┣━━ 🍃 fMCHits.fEvtID int32_t[]   ┣━━ 🍃 fMCHits.fScinID int32_t[]   ┣━━ 🍃 fMCHits.fTrackID int32_t[]   ┣━━ 🍃 fMCHits.fTrackPDGencoding int32_t[]   ┣━━ 🍃 fMCHits.fNumOfInteractions int32_t[]   ┣━━ 🍃 fMCHits.fGenGammaIndex int32_t[]   ┣━━ 🍃 fMCHits.fGenGammaMultiplicity int32_t[]   ┣━━ 🍃 fMCHits.fEneDep float[]   ┣━━ 🍃 fMCHits.fTime float[]   ┣━━ 🍃 fMCHits.fPosition TVector3[]   ┣━━ 🍃 fMCHits.fPolarizationIn TVector3[]   ┣━━ 🍃 fMCHits.fPolarizationOut TVector3[]   ┣━━ 🍃 fMCHits.fMomentumIn TVector3[]   ┣━━ 🍃 fMCHits.fMomentumOut TVector3[]   ┣━━ 🍁 fMCDecayTrees int32_t
┃   ┣━━ 🍃 fMCDecayTrees.fUniqueID uint32_t[]   ┣━━ 🍃 fMCDecayTrees.fBits uint8_t[]   ┣━━ 🍁 fGenInfo JPetGeantEventInformation*
┃   ┣━━ 🍁 fEvtIndex uint32_t
┃   ┣━━ 🍁 fHitIndex uint32_t
┃   ┗━━ 🍁 fMCDecayTreesIndex uint32_t
┣━━ 📊 gen_XY TH2F (121 × 121)
┣━━ 📊 gen_XZ TH2F (121 × 121)
┣━━ 📊 gen_YZ TH2F (121 × 121)
┣━━ 📊 gen_gamma_multiplicity TH1F (10)
┣━━ 📊 gen_hit_eneDepos TH1F (750)
┣━━ 📊 gen_hit_time TH1F (100)
┣━━ 📊 gen_hits_xy_pos TH2F (121 × 121)
┣━━ 📊 gen_hits_z_pos TH1F (100)
┣━━ 📊 gen_lifetime TH1F (100)
┣━━ 📊 gen_prompt_XY TH2F (121 × 121)
┣━━ 📊 gen_prompt_XZ TH2F (121 × 121)
┣━━ 📊 gen_prompt_YZ TH2F (121 × 121)
┗━━ 📊 gen_prompt_lifetime TH1F (100)

Development

See CONTRIBUTING.md for details on how to set up a development environment.

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

uproot_browser-0.3.0.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

uproot_browser-0.3.0-py3-none-any.whl (13.7 kB view hashes)

Uploaded Python 3

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