• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ROOT I/O in pure Python and NumPy.

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:

  • xrootd: if reading files with root:// URLs.
  • 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 agreement OAC-1836650 (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

💻

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

More Repositories

1

awkward

Manipulate JSON-like data with NumPy-like idioms.
Python
832
star
2

uproot3

ROOT I/O in pure Python and NumPy.
Python
315
star
3

iminuit

Jupyter-friendly Python interface for C++ MINUIT2
Python
280
star
4

pyhf

pure-Python HistFactory implementation with tensors and autodiff
Python
251
star
5

awkward-0.x

Manipulate arrays of complex data structures as easily as Numpy.
Python
215
star
6

mplhep

Extended histogram plotting on top of matplotlib and HEP collaboration compatible styling
Python
188
star
7

scikit-hep

Metapackage of Scikit-HEP project data analysis packages for Particle Physics.
Python
163
star
8

particle

Package to deal with particles, the PDG particle data table, PDGIDs, etc.
Python
149
star
9

boost-histogram

Python bindings for the C++14 Boost::Histogram library
Jupyter Notebook
143
star
10

root_numpy

The interface between ROOT and NumPy
Python
131
star
11

hist

Histogramming for analysis powered by boost-histogram
Python
127
star
12

root_pandas

A Python module for conveniently loading/saving ROOT files as pandas DataFrames
Python
109
star
13

histbook

Versatile, high-performance histogram toolkit for Numpy.
Jupyter Notebook
108
star
14

vector

Vector classes and utilities
Python
79
star
15

resample

Randomization-based inference in Python
Python
73
star
16

uproot-browser

A TUI viewer for ROOT files
Python
69
star
17

hepstats

Statistics tools and utilities.
Python
66
star
18

probfit

Cost function builder. For fitting distributions.
Jupyter Notebook
50
star
19

pylhe

Lightweight Python interface to read Les Houches Event (LHE) files
Python
39
star
20

decaylanguage

Package to parse decay files, describe and convert particle decays between digital representations.
Jupyter Notebook
38
star
21

vegascope

View Vega/Vega-Lite plots in your web browser from local or remote Python processes.
Python
36
star
22

numpythia

The interface between PYTHIA and NumPy
Cython
36
star
23

pyjet

The interface between FastJet and NumPy
C++
33
star
24

histoprint

Pretty print histograms to the console
Python
32
star
25

ragged

Manipulating ragged arrays in an Array API compliant way.
Python
29
star
26

cabinetry

design and steer profile likelihood fits
Python
25
star
27

fastjet

Jet-finding in the Scikit-HEP ecosystem.
Python
21
star
28

uproot3-methods

Pythonic behaviors for non-I/O related ROOT classes.
Python
21
star
29

hepunits

Units and constants in the HEP system of units
Python
21
star
30

pyhepmc

Easy-to-use Python bindings for HepMC3
Python
20
star
31

aghast

Aghast: aggregated, histogram-like statistics, sharable as Flatbuffers.
Python
17
star
32

scikit-hep-testdata

A common package to provide example files (e.g., ROOT) for testing and developing packages against.
C
13
star
33

formulate

Easy conversions between different styles of expressions
Python
12
star
34

scikit-hep.github.io

Pages defining the website of the Scikit-HEP project.
HTML
11
star
35

pyBumpHunter

Python implementation of the BumpHunter algorithm used by HEP community.
Jupyter Notebook
11
star
36

hepconvert

Python
11
star
37

uhi

Universal Histogram Interface
Python
9
star
38

scikit-hep-tutorials

Ecosystem tutorials, demos, examples
Jupyter Notebook
8
star
39

azure-wheel-helpers

Please use cibuildwheel instead!
Shell
8
star
40

NNDrone

Collection of tools and algorithms to enable conversion of HEP ML to mass usage model
Python
6
star
41

cuda-histogram

Histogramming tools on CUDA.
Python
6
star
42

scikit-hep-orgstats

Stats gathering tools for SciKit-HEP PyPI releases
Jupyter Notebook
3
star
43

manylinuxgcc

ManyLinux1 with modern GCC
Dockerfile
2
star
44

scikit-hep.github.io-source

Old sources for the Scikit-HEP org website pages.
Python
1
star