Skip to content

scikit-hep/hepconvert

Folders and files

NameName
Last commit message
Last commit date
Feb 11, 2025
Apr 7, 2024
Feb 13, 2025
Feb 13, 2025
Sep 19, 2023
Sep 19, 2023
Oct 20, 2023
Jan 31, 2024
Jan 11, 2024
Sep 19, 2023
Jul 1, 2024
Feb 2, 2024
Feb 10, 2025
Jan 11, 2024

Repository files navigation

Actions Status Documentation Status

PyPI version Conda-Forge PyPI platforms

GitHub Discussion

The hepconvert library is a bridge between columnar file formats, currently ROOT, and Parquet and soon will include HDF5. It aims to simplify file conversions in Python, replacing what is usually a multi-step process with one line of code, with builtin features for managing large datasets and choosing compression levels.

Installation

hepconvert can be installed from PyPI using pip:

pip install hepconvert

To install with Conda through conda-forge:

conda install -c conda-forge hepconvert

Getting started

import hepconvert

# To merge two or more root files with TTrees,
# and add together any histograms:
hepconvert.merge_root("destination.root",
["ttree_file1.root", "ttree_file2.root"])


# To add root files with only histograms:
hepconvert.add_histograms("destination.root",
["hist_file1.root", "hist_file2.root"])

To run merge_root from the command line:

hepconvert merge-root [options] [OUT_FILE] [IN_FILES]

To run add_histograms:

hepconvert add [options] [OUT_FILE] [IN_FILES]

Find details on each function's CLI options on the readthedocs.