Skip to main content

Pythonic interface to the HepMC3 C++ library licensed under LGPL-v3.

Project description

A Pythonic wrapper for the HepMC3 C++ library.

pyhepmc was formerly known as pyhepmc-ng. The development of pyhepmc-ng continues in the pyhepmc package.

HepMC3 has its own Python bindings. Why should you use these?

pyhepmc is easy to install

The command pip install pyhepmc just works on all common platforms. Since we publish binary wheels, you don’t need to compile anything. Since we include the HepMC3 library, you don’t need to install it separately either.

However, building from source is also easy. External software is not required. Just download the repository with git clone --recursive and run pip install -v -e ..

pyhepmc is Pythonic and Jupyter notebook-friendly

pyhepmc is a hand-crafted mapping of C++ code to Python, see documentation for details. Python idioms are supported where appropriate. The classes are designed to render well in Jupyter notebooks. IO is simplified. Events can be visualized in Jupyter notebooks.

pyhepmc supports visualizations powered by graphviz

pyhepmc can optionally visualize events, using the mature graphviz library as a backend.


pyhepmc is actively maintained

pyhepmc is part of the Scikit-HEP project, which aims to provide all tools needed by particle physicists to do data analysis in Python. It is developed in close collaboration with the HepMC3 project.

pyhepmc is thoroughly unit tested

We have 100% coverage for the Python API.


pyhepmc largely mirrors the C++ interface of the HepMC3 library, which is documented here. Parts of the documentation have been copied from HepMC3. Documentation is available as Python docstrings, so you can use Python’s help() browser to learn about the API. Alternatively, you can consult the online reference generated from these docstrings which includes some examples.


The pyhepmc code is covered by the BSD 3-clause license, but its main functionality comes from bundled software which is released under different licenses. The HepMC3 library is licensed under LGPL-v3 and bundles other software which is released under different licenses. See the files LICENSE and LICENSE_bundled in the source directory for details.

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

pyhepmc-2.7.1.tar.gz (354.5 kB view hashes)

Uploaded source

Built Distributions

pyhepmc-2.7.1-cp310-cp310-win_amd64.whl (443.2 kB view hashes)

Uploaded cp310

pyhepmc-2.7.1-cp39-cp39-win_amd64.whl (443.2 kB view hashes)

Uploaded cp39

pyhepmc-2.7.1-cp39-cp39-win32.whl (374.3 kB view hashes)

Uploaded cp39

pyhepmc-2.7.1-cp38-cp38-win_amd64.whl (443.1 kB view hashes)

Uploaded cp38

pyhepmc-2.7.1-cp38-cp38-win32.whl (374.1 kB view hashes)

Uploaded cp38

pyhepmc-2.7.1-cp37-cp37m-win_amd64.whl (440.7 kB view hashes)

Uploaded cp37

pyhepmc-2.7.1-cp37-cp37m-win32.whl (376.5 kB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page