Package: uproot4
Uproot is a reader and a writer of theROOT file formatusing only Python and Numpy. Unlike the standard C++ ROOT implementation, Uproot is only an I/O library, primarily intended to stream data into machine learning libraries in Python. Unlike PyROOT and root_numpy, Uproot does not depend on C++ ROOT. Instead, it uses Numpy to cast blocks of data from the ROOT file as Numpy arrays.InstallationUproot can be installedfrom PyPIusing pip (Awkward Arrayis optional but highly recommended):pipinstalluprootawkwardUproot is also available usingconda(so isAwkward Array, which conda installs automatically):condainstall-cconda-forgeuprootIf you have already addedconda-forgeas a channel, the-c conda-forgeis unnecessary. Adding the channel is recommended because it ensures that all of your packages use compatible versions:condaconfig--addchannelsconda-forge
condaupdate--allNote:if you need towriteROOT files, you'll need to use the deprecateduproot3for now. This feature is coming to the new version soon.Getting helpStart with thetutorials and reference documentation.Report bugs, request features, and ask for additional documentation onGitHub Issues.If you have a "How do I...?" question, ask about it onStackOverflow 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 GitterScikit-HEP/uprootchat room.Installation for developersUproot is an ordinary Python library; you can get a copy of the code withgitclonehttps://github.com/scikit-hep/uproot4.gitand install it locally by callingpip install .in the repository directory.If you need to develop Awkward Array as well, see itsinstallation for developers.DependenciesUproot's only strict dependency is NumPy.This is the only dependency that pip will automatically install.Awkward Array is highly recommended.It is not a strict dependency to allow Uproot to be used in restrictive environments. If you're using Uproot without Awkward Array, you'll have to use thelibrary="np"option or globally setuproot.default_libraryto return arrays as NumPy arrays (see documentation).awkward: be sure to use Awkward Array 1.x.The following libraries are also useful in conjunction with Uproot, but are not necessary. If you call a function that needs one, you'll be prompted to install it. (Conda installs most of these automatically.)For ROOT files, compressed different ways:lz4andxxhash: only if reading ROOT files that have been LZ4-compressed.zstandard: only if reading ROOT files that have been ZSTD-compressed.backports.lzma: only if reading ROOT files that have been LZMA-compressed (in Python 2).For remote data:xrootd: only if reading files withroot://URLs.For exporting data to other libraries:pandas: only iflibrary="pd".cupy: only iflibrary="cp"(reads arrays onto GPUs).boost-histogram: only if converting histograms toboost-histogramwithhistogram.to_boost().hist: only if converting histograms tohistwithhistogram.to_hist().AcknowledgementsSupport for this work was provided by NSF cooperative agreement OAC-1836650 (IRIS-HEP), grant OAC-1450377 (DIANA/HEP) and PHY-1520942 (US-CMS LHC Ops).Thanks especially to the gracious help of Uproot contributors (including theoriginal repository).Jim Pivarski💻📖🚇🚧Pratyush Das💻🚇Chris Burr💻🚇Dmitri Smirnov💻Matthew Feickert🚇Tamas Gal💻Luke Kreczko💻⚠️Nicholas Smith💻Noah Biederbeck💻Oksana Shadura💻🚇Henry Schreiner💻🚇⚠️Mason Proffitt💻⚠️Jonas Rembser💻benkrikler💻Hans Dembinski📖Marcel R.💻Ruggero Turra💻Jonas Rübenach💻bfis💻Raymond Ehlers💻Andrzej Novak💻Josh Bendavid💻Doug Davis💻Chao Gu💻Lukas Koch💻Michele Peresano💻Edoardo💻JMSchoeffmann💻alexander-held💻💻: code, 📖: documentation, 🚇: infrastructure, 🚧: maintainance, ⚠: tests and feedback, 🤔: foundational ideas.