Skip to main content

ROOT I/O in pure Python and NumPy.

Project description

Scikit-HEP NSF-1836650 DOI Python 3.5‒3.9 License

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 (awkward1 is optional but highly recommended):

pip install uproot4 awkward1

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

conda install -c conda-forge uproot4

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.

  • Report bugs, request features, and ask for additional documentation on GitHub Issues.
  • If you have a "How do I...?" question, ask about it on StackOverflow 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 Gitter Scikit-HEP/uproot chat room.

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 to return arrays as NumPy arrays (see documentation).

  • awkward1: 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 awkward-array 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

💻

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

Project details


Download files

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

Source Distribution

uproot4-4.0.0rc2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

uproot4-4.0.0rc2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file uproot4-4.0.0rc2.tar.gz.

File metadata

  • Download URL: uproot4-4.0.0rc2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.5

File hashes

Hashes for uproot4-4.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 a165a755f328611e428e1f75e24d6b192fa98e42fad1ac75a4fb899a4168ac96
MD5 5d6dccb31f497c9969081940b2c46b73
BLAKE2b-256 31039d1f68648d791b1f0a7a357790cfacc9f2400f44bd8322e3d938ccafd5d5

See more details on using hashes here.

File details

Details for the file uproot4-4.0.0rc2-py3-none-any.whl.

File metadata

  • Download URL: uproot4-4.0.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.5

File hashes

Hashes for uproot4-4.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 c771f0ad8abea065a2c61a7f8a644d10c1c7c781cc7e8bc5b073468913b4a5ce
MD5 993d4d30a3805f363de684d285192922
BLAKE2b-256 c075f6e7998a1dc3a77eca9b0b781fa3f92b0c5f026e1c073c6c2e444a380ecf

See more details on using hashes here.

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