Uproot


PyPI version Conda-Forge Python 3.5‒3.9 BSD-3 Clause License Continuous integration tests

Scikit-HEP NSF-1836650 DOI 10.5281/zenodo.4340632 Documentation Gitter


Uproot is a library for reading (and soon, writing) ROOT files in pure Python and NumPy.

How to install

Usually, you’ll want to install Uproot with Awkward Array because this is the default array format.

pip install uproot awkward

But if you are working in a limited environment, Uproot can be installed without Awkward Array.

pip install uproot

Just be sure to pass library="np" to any function that returns arrays or globally set uproot.default_library to specify that you want NumPy arrays, rather than Awkward Arrays. Alternatively, you can specify library="pd" for Pandas, which, like Awkward Array, would need to be explicitly installed.

Documentation

ROOT is a C++ toolkit for data analysis, part of which is the ROOT file format. Over an exabyte of particle physics data are stored in ROOT files around the world.

Uproot is a Python implementation of ROOT I/O, independent of the ROOT toolkit itself (including ROOT’s Python interface, PyROOT).

  • If you need help understanding ROOT and its ecosystem, see the ROOT project documentation.

  • If you know what a ROOT file is but are unfamiliar with Uproot, see the Getting started guide.

  • If you are migrating from an older version to Uproot 4, see the Uproot 3 → 4 cheat-sheet.

  • If you need detailed descriptions of a class’s properties or a function’s parameters, see the left-bar on this site (≡ button on mobile) or use help in Python, ? or shift-tab in iPython/Jupyter.

Getting help

  • Report bugs, request features, and ask for additional documentation on GitHub Issues.

  • If you have a “How do I…?” question, start a GitHub Discussion with category “Q&A”.

  • Alternatively, ask about it on StackOverflow with the [uproot] tag. Be sure to include tags for any other libraries that you use, such as Pandas or PyTorch.

  • To ask questions in real time, try the Gitter Scikit-HEP/uproot chat room.