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.2.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

uproot_browser-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file uproot_browser-0.2.0.tar.gz.

File metadata

  • Download URL: uproot_browser-0.2.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for uproot_browser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73f71aa396835267825e07bf1c6696ecc5d3693d7d8136712c61e123a2f5cbf8
MD5 5c7f30dd85b648b8cf48ffefc31ea93d
BLAKE2b-256 121105050890327128f4359099f323ffe3e40de1c257c61a182dbb8635fae7e3

See more details on using hashes here.

File details

Details for the file uproot_browser-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: uproot_browser-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for uproot_browser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e7a6eda04007791134918cbe2de750d52617bd91dd7910bb0debd246a4d3e0
MD5 b6965f7273d61abf1a189be4f93a79a4
BLAKE2b-256 f7498d4080f098fcdf042cf8a7e2489e4114542351fe43d41b80f6ee4b9ab2fb

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