Package: uproot
Uproot is a library for reading and writingROOT filesin pure 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.pipinstalluprootUproot is also available usingconda.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 (seeconda-forge docs):condaconfig--addchannelsconda-forge
condaupdate--allGetting 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, start aGitHub Discussionwith category "Q&A".Alternatively, 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/uproot5.gitand install it locally by callingpip install -e .in the repository directory.If you need to develop Awkward Array as well, see itsinstallation for developers.DependenciesUproot's only strict dependencies are NumPy and packaging.Strict dependencies are automatically installed by pip (or conda).Awkward Arrayis highly recommendedand is automatically installed by pip (or conda), though it ispossibleto use Uproot without it. If you need a minimal installation, pass--no-depsto pip and passlibrary="np"to every array-fetching function, or globally setuproot.default_libraryto get NumPy arrays instead of Awkward Arrays.awkward: Uproot 5.x requires Awkward 2.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: if reading ROOT files that have been LZ4-compressed.zstandard: if reading ROOT files that have been ZSTD-compressed.ZLIB and LZMA are built in (Python standard library).For accessing remote files:minio: if reading files withs3://URIs.xrootd: if reading files withroot://URIs.HTTP/S access is built in (Python standard library).For distributed computing withDask:dask: seeuproot.dask.dask-awkward: for data with irregular structure ("jagged" arrays), seedask-awkward.For exporting TTrees toPandas:pandas: iflibrary="pd".awkward-pandas: iflibrary="pd"and the data have irregular structure ("jagged" arrays), seeawkward-pandas.For exporting histograms:boost-histogram: if converting histograms toboost-histogramwithhistogram.to_boost().hist: if converting histograms tohistwithhistogram.to_hist().AcknowledgementsSupport for this work was provided by NSF cooperative agreementsOAC-1836650andPHY-2323298(IRIS-HEP), grantOAC-1450377(DIANA/HEP), andPHY-2121686(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💻Giordon Stark💻Ryunosuke O'Neil💻ChristopheRappold📖Cosmin Deaconu⚠️💻Carlos Pegueros📖💡⚠️✅Benjamin Tovar💻Duncan Macleod🚇mpad💻Peter Fackeldey💻Kush Kothari💻Aryan Roy💻Jerry Ling💻kakwok💻Dmitry Kalinkin💻🚇Nikolai Hartmann💻Kilian Lieret📖Daniel Cervenkov💻Beojan Stanislaus💻Angus Hollands💻🚧Luis Antonio Obis Aparicio💻renyhp💻Lindsey Gray💻ioanaif💻OTABI Tomoya⚠️Jost Migenda📖Gaétan Lepage⚠️HaarigerHarald💻Ben Greiner⚠️Robin Sonnabend💻💻: code, 📖: documentation, 🚇: infrastructure, 🚧: maintainance, ⚠: tests/feedback, 🤔: foundational ideas.