Skip to main content

ROOT I/O in pure Python and NumPy.

Project description

PyPI version Conda-Forge Python 3.7‒3.12 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 writing ROOT files in 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.

Installation

Uproot can be installed from PyPI using pip.

pip install uproot

Uproot is also available using conda.

conda install -c conda-forge uproot

If you have already added conda-forge as a channel, the -c conda-forge is unnecessary. Adding the channel is recommended because it ensures that all of your packages use compatible versions (see conda-forge docs):

conda config --add channels conda-forge
conda update --all

Getting help

Start with the tutorials and reference documentation.

Installation for developers

Uproot is an ordinary Python library; you can get a copy of the code with

git clone https://github.com/scikit-hep/uproot5.git

and install it locally by calling pip install -e . in the repository directory.

If you need to develop Awkward Array as well, see its installation for developers.

Dependencies

Uproot's only strict dependencies are NumPy and packaging. Strict dependencies are automatically installed by pip (or conda).

Awkward Array is highly recommended and is automatically installed by pip (or conda), though it is possible to use Uproot without it. If you need a minimal installation, pass --no-deps to pip and pass library="np" to every array-fetching function, or globally set uproot.default_library to 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:

  • lz4 and xxhash: 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 with s3:// URIs.
  • xrootd: if reading files with root:// URIs.
  • HTTP/S access is built in (Python standard library).

For distributed computing with Dask:

For exporting TTrees to Pandas:

  • pandas: if library="pd".
  • awkward-pandas: if library="pd" and the data have irregular structure ("jagged" arrays), see awkward-pandas.

For exporting histograms:

  • boost-histogram: if converting histograms to boost-histogram with histogram.to_boost().
  • hist: if converting histograms to hist with histogram.to_hist().

Acknowledgements

Support for this work was provided by NSF cooperative agreements OAC-1836650 and PHY-2323298 (IRIS-HEP), grant OAC-1450377 (DIANA/HEP), and PHY-2121686 (US-CMS LHC Ops).

Thanks especially to the gracious help of Uproot contributors (including the original repository).

Jim Pivarski
Jim Pivarski

💻 📖 🚇 🚧
Pratyush Das
Pratyush Das

💻 🚇
Chris Burr
Chris Burr

💻 🚇
Dmitri Smirnov
Dmitri Smirnov

💻
Matthew Feickert
Matthew Feickert

🚇
Tamas Gal
Tamas Gal

💻
Luke Kreczko
Luke Kreczko

💻 ⚠️
Nicholas Smith
Nicholas Smith

💻
Noah Biederbeck
Noah Biederbeck

💻
Oksana Shadura
Oksana Shadura

💻 🚇
Henry Schreiner
Henry Schreiner

💻 🚇 ⚠️
Mason Proffitt
Mason Proffitt

💻 ⚠️
Jonas Rembser
Jonas Rembser

💻
benkrikler
benkrikler

💻
Hans Dembinski
Hans Dembinski

📖
Marcel R.
Marcel R.

💻
Ruggero Turra
Ruggero Turra

💻
Jonas Rübenach
Jonas Rübenach

💻
bfis
bfis

💻
Raymond Ehlers
Raymond Ehlers

💻
Andrzej Novak
Andrzej Novak

💻
Josh Bendavid
Josh Bendavid

💻
Doug Davis
Doug Davis

💻
Chao Gu
Chao Gu

💻
Lukas Koch
Lukas Koch

💻
Michele Peresano
Michele Peresano

💻
Edoardo
Edoardo

💻
JMSchoeffmann
JMSchoeffmann

💻
alexander-held
alexander-held

💻
Giordon Stark
Giordon Stark

💻
Ryunosuke O'Neil
Ryunosuke O'Neil

💻
ChristopheRappold
ChristopheRappold

📖
Cosmin Deaconu
Cosmin Deaconu

⚠️ 💻
Carlos Pegueros
Carlos Pegueros

📖 💡 ⚠️
Benjamin Tovar
Benjamin Tovar

💻
Duncan Macleod
Duncan Macleod

🚇
mpad
mpad

💻
Peter Fackeldey
Peter Fackeldey

💻
Kush Kothari
Kush Kothari

💻
Aryan Roy
Aryan Roy

💻
Jerry Ling
Jerry Ling

💻
kakwok
kakwok

💻
Dmitry Kalinkin
Dmitry Kalinkin

💻 🚇
Nikolai Hartmann
Nikolai Hartmann

💻
Kilian Lieret
Kilian Lieret

📖
Daniel Cervenkov
Daniel Cervenkov

💻
Beojan Stanislaus
Beojan Stanislaus

💻
Angus Hollands
Angus Hollands

💻 🚧
Luis Antonio Obis Aparicio
Luis Antonio Obis Aparicio

💻
renyhp
renyhp

💻
Lindsey Gray
Lindsey Gray

💻
ioanaif
ioanaif

💻
OTABI Tomoya
OTABI Tomoya

⚠️
Jost Migenda
Jost Migenda

📖
Gaétan Lepage
Gaétan Lepage

⚠️
HaarigerHarald
HaarigerHarald

💻
Ben Greiner
Ben Greiner

⚠️
Robin Sonnabend
Robin Sonnabend

💻
Bo Johnson
Bo Johnson

💻
Miles
Miles

💻
djw9497
djw9497

💻
Piotr Sobczyński
Piotr Sobczyński

💻

💻: code, 📖: documentation, 🚇: infrastructure, 🚧: maintainance, ⚠: tests/feedback, 🤔: foundational ideas.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uproot-5.3.11.tar.gz (932.0 kB view details)

Uploaded Source

Built Distribution

uproot-5.3.11-py3-none-any.whl (356.0 kB view details)

Uploaded Python 3

File details

Details for the file uproot-5.3.11.tar.gz.

File metadata

  • Download URL: uproot-5.3.11.tar.gz
  • Upload date:
  • Size: 932.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for uproot-5.3.11.tar.gz
Algorithm Hash digest
SHA256 24729b83797cdf5ac30d9851d7549a94d833f63d7906dfbf055096de514cb215
MD5 c84799cceba97b6c495699d0c9c1792d
BLAKE2b-256 20d25d216f2e33487b4ec069535425667ab382397c692895931a2e319ce30b5d

See more details on using hashes here.

Provenance

File details

Details for the file uproot-5.3.11-py3-none-any.whl.

File metadata

  • Download URL: uproot-5.3.11-py3-none-any.whl
  • Upload date:
  • Size: 356.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for uproot-5.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 30a93eaa5c5d8fa9c51b628627756168da0d9b7b7bb9c7a5529f7f5556902ed0
MD5 3e4e9bb30dd03a5221af26f36b8630aa
BLAKE2b-256 f05cca28cda6050a95cf1012e7223d27e25633ec0879a9467ed34e974c7d50bd

See more details on using hashes here.

Provenance

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