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.

https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg https://badge.fury.io/py/pyhepmc.svg https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg?branch=main https://zenodo.org/badge/DOI/10.5281/zenodo.7013498.svg

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, Numpy-friendy, and Jupyter notebook-friendly

pyhepmc is a hand-crafted mapping of C++ code to Python, see documentation for details, while the official HepMC3 bindings are generated by a script. The pyhepmc API has been optimised for safety, usability, and efficiency by a human expert, something that an automatic tool cannot provide. pyhepmc brings these unique features:

  • Python idioms are supported where appropriate.

  • Simple IO with pyhepmc.open.

  • An alternative Numpy API accelerates event processing up to 70x compared to the standard API.

  • The public API is fully documented with Python docstrings.

  • Objects are inspectable in Jupyter notebooks (have useful repr strings).

  • Events render as graphs in Jupyter notebooks (see next item).

pyhepmc supports visualizations powered by graphviz

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

docs/_static/pyhepmc.svg

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 close to 100% coverage for the Python API.

Documentation

Documentation is available here, and includes some examples (Jupyter notebooks). Furthermore, you can use Python’s help() browser to learn about the API. The documentation is generated from Python docstrings, which are translated from the HepMC3 library, which is documented here.

License

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.13.4.tar.gz (371.3 kB view hashes)

Uploaded Source

Built Distributions

pyhepmc-2.13.4-cp312-cp312-win_amd64.whl (488.3 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pyhepmc-2.13.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (617.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyhepmc-2.13.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (570.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pyhepmc-2.13.4-cp312-cp312-macosx_10_9_x86_64.whl (573.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyhepmc-2.13.4-cp312-cp312-macosx_10_9_universal2.whl (1.1 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.13.4-cp311-cp311-win_amd64.whl (487.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pyhepmc-2.13.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (620.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyhepmc-2.13.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (573.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pyhepmc-2.13.4-cp311-cp311-macosx_10_9_x86_64.whl (564.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyhepmc-2.13.4-cp311-cp311-macosx_10_9_universal2.whl (1.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.13.4-cp310-cp310-win_amd64.whl (486.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyhepmc-2.13.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (619.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyhepmc-2.13.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (572.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pyhepmc-2.13.4-cp310-cp310-macosx_10_9_x86_64.whl (564.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyhepmc-2.13.4-cp310-cp310-macosx_10_9_universal2.whl (1.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.13.4-cp39-cp39-win_amd64.whl (486.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyhepmc-2.13.4-cp39-cp39-win32.whl (413.7 kB view hashes)

Uploaded CPython 3.9 Windows x86

pyhepmc-2.13.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (572.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pyhepmc-2.13.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (559.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pyhepmc-2.13.4-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (577.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

pyhepmc-2.13.4-cp39-cp39-macosx_10_9_x86_64.whl (564.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyhepmc-2.13.4-cp39-cp39-macosx_10_9_universal2.whl (1.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.13.4-cp38-cp38-win_amd64.whl (487.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyhepmc-2.13.4-cp38-cp38-win32.whl (413.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

pyhepmc-2.13.4-cp38-cp38-macosx_10_9_x86_64.whl (564.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyhepmc-2.13.4-cp38-cp38-macosx_10_9_universal2.whl (1.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page