This repository provides a Python toolset for converting ROOT files to another format. It includes functionalities for reading data from ROOT files branches and saving them as other file formats.
Additionally, we can explore the file structure & print a dataframe. Ξ€he mutual compatibility and installation of the Python packages used to read and convert .root files ensure minimal dependency conflicts.
The scope of this work, was to create a general tool for converting ROOT files to other formats.
-
Directory Structure - Construct the following directories in your project:
- data/root: Ensure that you have this directory containing ROOT files.
- data/h5: Directory where HDF5 files will be saved (if not present it will be created).
- data/sqlite: Directory where SQLite files will be saved (if not present it will be created).
- data/parquet: Directory where Parquet files will be saved (if not present it will be created).
-
User Interface - Upon running the script, you'll be prompted to choose one of the following options:
- Read a HDF5 | SQLite | Parquet file
- Convert ROOT files to HDF5 | SQLite | Parquet
- Exit the program.
root2data/
β
βββ .gitignore
βββ LICENCSE
βββ README.md
βββ create_env.sh
βββ main.py
βββ requirements.txt
βββ data/ # this folder is created if not present
β βββ h5/
β βββ parquet/
β βββ root/
β βββ sqlite/
βββ utils/
β βββ __init__.py
β βββ conversion.py
β βββ data_ops.py
β βββ file_ops.py
β βββ hdf5_ops.py
β βββ parquet_ops.py
β βββ sqlite_ops.py
β βββ ui_ops.py
βββ src/
βββ transform.py
root_file/
β
βββ Tree;1/
β βββ variable_1.1
β βββ variable_1.2
β βββ variable_1.3
β ...
β βββ variable1_N
β
βββ Tree;2
β βββ variable_2.1
β βββ variable_2.2
β βββ variable_2.3
β ...
β βββ variable_2.N
...
βββ Tree;M/
βββ variable_M.1
βββ variable_M.2
βββ variable_M.3
...
βββ variable_M.N
The following will create a python virtual environment and at the same time activate it:
source create_env.sh
Another way is to create the virtual environment manually:
python3 -m venv root2data
After that, activate the virtual environment:
source root2data/bin/activate
Then execute the following to install required packages:
pip install -r requirements.txt
Both methods, assure that you have created a virtual env called root2data
For step-by-step instructions check WALKTHROUGH.md
Please feel free to contact
This project is licensed under the Apache License. See the LICENSE for details.
User contributions can be submitted via pull request on GitHub. We recommend that you create your own fork of root2data on GitHub and use it to submit your patches.


