Skip to main content
Help us improve Python packaging – donate today!

A pythonic layer on top of the ROOT framework's PyROOT bindings.

Project Description

Python has become the language of choice for high-level applications where fast prototyping and efficient development are important, while glueing together low-level libraries for performance-critical tasks. The PyROOT bindings introduced ROOT into the Python arena, however, interacting with ROOT in Python should not “feel” like you are writing C++. Python also offers a multitude of powerful packages such as SciPy, NumPy, IPython, matplotlib, and PyTables, but a suitable interface between them and ROOT has been lacking.

The rootpy project is a community-driven initiative aiming to provide a more pythonic interface with ROOT on top of the existing PyROOT bindings. Several key features include:

  • Improvements to help you create and manipulate trees, histograms, cuts and vectors.
  • Colours and other style attributes can be referred to by descriptive strings.
  • Get and Set methods on ROOT objects are also properties.
  • Provides a way of mapping ROOT trees onto python objects and collections.
  • Easy navigation through ROOT files. You can now access objects with my_file.some_directory.tree_name, for example.
  • Dictionaries for STL types are compiled for you automatically.
  • Redirect ROOT’s messages through Python’s logging system.
  • Optionally turn ROOT errors into Python exceptions.
  • Plot your ROOT histograms or graphs with matplotlib.
  • Conversion of ROOT trees into NumPy ndarrays and recarrays through the related root_numpy package. Now take advantage of the many statistical and numerical packages that Python offers (NumPy, SciPy, StatsModels, and scikit-learn).
  • Conversion of ROOT files containing trees into HDF5 format with PyTables.
  • roosh, a Bash-like shell environment for the ROOT file
  • rootpy, a command for common tasks such as summing histograms or drawing tree expressions over multiple files, listing the contents of a file, or inspecting tree branches and their sizes and types.


View the documentation at or (a possibly more up-to-date version) at

Also see an introductory presentation here:


  • Python 2.6 or 2.7 (Python 3 is currently not supported, but see this issue for progress)
  • ROOT 5.28+ with PyROOT enabled

The following dependencies are optional:

rootpy is developed and tested on Linux and Mac.

Getting the Latest Source

Clone the repository with git:

git clone git://

or checkout with svn:

svn checkout


svn does not checkout git submodules so you will end up with an incomplete rootpy.

Manual Installation

If you have obtained a copy of rootpy yourself use the script to install.

To install in your home directory:

python install --user

To install system-wide (requires root privileges):

sudo python install

To install optional requirements (matplotlib, NumPy, etc.):

pip install -U -r requirements/[roosh|array|...].txt

Automatic Installation

To install a released version of rootpy use pip.


This will install the latest version of rootpy on PyPI which may be lacking many new unreleased features.

To install in your home directory:

pip install --user rootpy

To install system-wide (requires root privileges):

sudo pip install rootpy

To install optional requirements (matplotlib, NumPy, etc.):

pip install --user rootpy[array,matplotlib,...]

This requires pip version 1.1 or later.

Try rootpy on CERN’s LXPLUS

First, set up ROOT:

source /afs/ &&\
cd /afs/ &&\
source bin/ &&\
cd -

Then, create and activate a virtualenv (change my_env at your will):

virtualenv my_env # necessary only the first time
source my_env/bin/activate

Get the latest source:

git clone

and install it:

~/my_env/bin/python rootpy/ install

Note that neither sudo nor --user is used, because we are in a virtualenv.

rootpy should now be ready to use:

>>> import rootpy


If you installed rootpy into your home directory with the --user option above, add ${HOME}/.local/bin to your ${PATH} if it is not there already (put this in your .bashrc):

export PATH=${HOME}/.local/bin${PATH:+:$PATH}

Running the Tests

Testing requires the nose package. Once rootpy is installed, it may be tested (from outside the source directory) by running:

nosetests --exe -v -a '!slow' rootpy

rootpy can also be tested before installing by running this from inside the source directory:

make test


Please post on the list if you have ideas or contributions. Feel free to fork rootpy on GitHub and later submit a pull request.

IRC Channel

See #rootpy on freenode.

IRC is banned at CERN since it reveals your hostname to people in the chatroom, making you interesting to attackers. But you can safely access it through this web link:

Have Questions or Found a Bug?

Post your questions on and use the tag rootpy (this tag does not exist yet, but if you have a reputation of at least 1500 then please create it).

Think you found a bug? Open a new issue here:

Also feel free to post questions or follow discussion on the rootpy-users or rootpy-dev Google groups.

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
rootpy-0.7.1.tar.gz (305.4 kB) Copy SHA256 hash SHA256 Source None Mar 11, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page