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.

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

โš ๏ธ

๐Ÿ’ป: 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.2.0rc3.tar.gz (907.2 kB view details)

Uploaded Source

Built Distribution

uproot-5.2.0rc3-py3-none-any.whl (343.2 kB view details)

Uploaded Python 3

File details

Details for the file uproot-5.2.0rc3.tar.gz.

File metadata

  • Download URL: uproot-5.2.0rc3.tar.gz
  • Upload date:
  • Size: 907.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for uproot-5.2.0rc3.tar.gz
Algorithm Hash digest
SHA256 6658ec5f8439b09c1b5f10ea6e55c155b59279448710ffa183384e4fc5c63652
MD5 bb20786e3862fb535e18e6e628c48d6a
BLAKE2b-256 be87c81b32784ebfec301d9e085d185ed3e3a388a1b15014227d670053a1e444

See more details on using hashes here.

Provenance

File details

Details for the file uproot-5.2.0rc3-py3-none-any.whl.

File metadata

  • Download URL: uproot-5.2.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 343.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for uproot-5.2.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f42b40600b747e1186fbc767a733bff644c66a3313b9d7f6b51dc59028868c26
MD5 44e4ff5176bc1dbd079acda8d95cfe6d
BLAKE2b-256 8d129bdc6089c86829ab034bd718c32e940289428d958cbba0845e788a276483

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