Skip to main content

ROOT I/O in pure Python and NumPy.

Project description

PyPI version Conda-Forge Python 3.7โ€’3.11 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. Awkward Array is optional but highly recommended:

pip install uproot awkward

Uproot is also available using conda (in this case, Awkward Array is automatically installed):

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/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 dependencies are NumPy and packaging. You'll also need importlib_metadata if you are on Python 3.7. These will be automatically installed when you install uproot.

Awkward Array is highly recommended. It is not a strict dependency, but is included in the dependencies to help most users; install without dependencies (--no-deps with pip) if you want to avoid awkward. 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.

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

๐Ÿ“– ๐Ÿ’ก โš ๏ธ โœ…

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

๐Ÿ’ป ๐Ÿšง

๐Ÿ’ป: 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.0.0rc4.tar.gz (862.4 kB view details)

Uploaded Source

Built Distribution

uproot-5.0.0rc4-py3-none-any.whl (321.1 kB view details)

Uploaded Python 3

File details

Details for the file uproot-5.0.0rc4.tar.gz.

File metadata

  • Download URL: uproot-5.0.0rc4.tar.gz
  • Upload date:
  • Size: 862.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for uproot-5.0.0rc4.tar.gz
Algorithm Hash digest
SHA256 ec61caa0e7e2cc82595e11a5c23994b65bc248492743ff93f16ea4b211adbbf6
MD5 6a1c31ea20347612dad47fe1257d3fbe
BLAKE2b-256 4a37f111001fab4a7cd670610d72652f00bce95dfb8fd5254c3c4a9b5ddf05ec

See more details on using hashes here.

Provenance

File details

Details for the file uproot-5.0.0rc4-py3-none-any.whl.

File metadata

  • Download URL: uproot-5.0.0rc4-py3-none-any.whl
  • Upload date:
  • Size: 321.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for uproot-5.0.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 0135f651cf7fe77f614ecd2e2d41dfd05a7ed738fe0fa07e98b30d0139266582
MD5 a5cc8c2324835d5b1b648cd04d466b0c
BLAKE2b-256 5c193033158016b31cca767e56ae740b434d19b5e30a18a651566cc659d5bc2e

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