Uproot: ROOT I/O in pure Python and NumPy.

Nearly all of the functions needed for general use are imported here, but the documentation gives fully qualified names. For example, the most frequently used function in Uproot is


but we refer to it in the documentation as uproot.open.

Typical entry points for file-reading are

though they would usually be accessed as uproot.iterate, uproot.concatenate, and uproot.dask.

The most useful classes are

though they would usually be accessed through instances that have been read from files.

The submodules of Uproot are:

  • uproot.reading: entry-point for reading files, as well as classes for the three basic types that can’t be modeled: TFile, TDirectory, and TKey.

  • uproot.behaviors: methods and properties to mix into instantiated models, for a high-level user interface.

  • uproot.model: utilities for modeling C++ objects as Python objects.

  • uproot.streamers: models for TStreamerInfo and its elements to generate code for new models for classes in ROOT files.

  • uproot.cache: defines caches with least-recently used eviction policies.

  • uproot.compression: functions for compressing and decompressing data.

  • uproot.deserialization: utility functions for deserialization, including the generation of new classes.

  • uproot.source: the “physical layer,” which reads bytes without interpreting them from various backends, like files, HTTP(S), and XRootD.

  • uproot.interpretation: prescriptions for converting ROOT types into Pythonic arrays.

  • uproot.containers: interpretations and models for standard containers, such as std::vector and arrays.

  • uproot.language: computational backends for expressions in arrays.

  • uproot.models: predefined models for classes that are too basic to rely on TStreamerInfo or too common to justify reading it.

  • uproot.const: integer constants used in ROOT serialization and deserialization.

  • uproot.extras: import functions for the libraries that Uproot can use, but does not require as dependencies. If a library can’t be imported, these functions provide instructions for installing them.

  • uproot.version: for access to the version number.

  • uproot.dynamic: initially empty module, in which dynamically generated classes are defined.

  • uproot._util: non-public utilities used by the above.