Skip to main content

ROOT I/O in pure Python and NumPy.

Project description

PyPI version Conda-Forge Python 2.7,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 reader and a writer of the ROOT file format using 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.

Installation

Uproot can be installed from PyPI using pip (Awkward Array is optional but highly recommended):

pip install uproot awkward

Uproot is also available using conda (so is Awkward Array, which conda installs automatically):

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:

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

Note: if you need to write ROOT files, you'll need to use the deprecated uproot3 for now. This feature is coming to the new version soon.

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/uproot4.git

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

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

Dependencies

Uproot'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 the library="np" option or globally set uproot.default_library to 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:

  • lz4 and xxhash: 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 with root:// URLs.

For exporting data to other libraries:

  • pandas: only if library="pd".
  • cupy: only if library="cp" (reads arrays onto GPUs).
  • boost-histogram: only if converting histograms to boost-histogram with histogram.to_boost().
  • hist: only if converting histograms to hist with histogram.to_hist().

Acknowledgements

Support 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 the original 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

📖 💡 ⚠️

💻: code, 📖: documentation, 🚇: infrastructure, 🚧: maintainance, ⚠: tests and 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-4.0.10.tar.gz (206.5 kB view details)

Uploaded Source

Built Distribution

uproot-4.0.10-py2.py3-none-any.whl (245.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: uproot-4.0.10.tar.gz
  • Upload date:
  • Size: 206.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for uproot-4.0.10.tar.gz
Algorithm Hash digest
SHA256 b7f9786d87227fcdc6b84305a6219cd615844f934e3b7c2509e2d4ed095950ab
MD5 0924de2c4dcca60e2d078afbd789c889
BLAKE2b-256 25c9a11a3cd734f2e6485c4b09fe02d60f91cb6064116ccb5c1b9231aa482d75

See more details on using hashes here.

Provenance

File details

Details for the file uproot-4.0.10-py2.py3-none-any.whl.

File metadata

  • Download URL: uproot-4.0.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 245.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for uproot-4.0.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01694bb3e31ac66029467a75b857c9c96c2f71314d50d876fe199f980815e823
MD5 bd7e666c9ddf40a9623260f5d93015a7
BLAKE2b-256 6429509d02ac708979f6982c199d65faefb76dc6a500a65eef8703633b0dd51c

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