Skip to main content

Pythonic interface to the HepMC3 C++ library.

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=develop 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 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.

  • C++ methods which act like properties are represented as properties, e.g. GenParticle::set_status and GenParticle::status are mapped to a single GenParticle.status field in Python.

  • Tuples and lists are implicitly convertible to FourVector and ToolInfo objects.

  • Vectors of objects on the C++ side are mapped to Python lists.

  • Reader and Writer classes support the context manager protocol. Reader objects can be iterated over.

  • A convenient open function is provided for reading and writing HepMC files.

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. There is also official collaboration with the HepMC3 project.

pyhepmc is thoroughly unit tested

We aim for 100% coverage, not quite there yet.

Documentation

pyhepmc mirrors the C++ interface of the HepMC3 library, which is documented here. The documentation is mostly copied from HepMC3 and available as Python docstrings, so you can use Python’s help() browser to learn about the API. Alternatively, you can consult our online reference generated from these docstrings.

License

pyhepmc is covered by the BSD 3-clause license, see the LICENSE file for details. This license only applies to the pyhepmc code. The connected external libraries HepMC3 and pybind11 are covered by other licenses, as described in their respective LICENSE files.

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.6.0.tar.gz (453.3 kB view details)

Uploaded Source

Built Distributions

pyhepmc-2.6.0-cp310-cp310-win_amd64.whl (440.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyhepmc-2.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (570.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyhepmc-2.6.0-cp310-cp310-macosx_10_9_x86_64.whl (510.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyhepmc-2.6.0-cp310-cp310-macosx_10_9_universal2.whl (939.6 kB view details)

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

pyhepmc-2.6.0-cp39-cp39-win_amd64.whl (440.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyhepmc-2.6.0-cp39-cp39-win32.whl (371.3 kB view details)

Uploaded CPython 3.9 Windows x86

pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (513.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (530.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

pyhepmc-2.6.0-cp39-cp39-macosx_10_9_x86_64.whl (510.1 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyhepmc-2.6.0-cp39-cp39-macosx_10_9_universal2.whl (939.8 kB view details)

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

pyhepmc-2.6.0-cp38-cp38-win_amd64.whl (440.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyhepmc-2.6.0-cp38-cp38-win32.whl (371.3 kB view details)

Uploaded CPython 3.8 Windows x86

pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (513.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (530.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

pyhepmc-2.6.0-cp38-cp38-macosx_10_9_x86_64.whl (510.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyhepmc-2.6.0-cp38-cp38-macosx_10_9_universal2.whl (939.7 kB view details)

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

pyhepmc-2.6.0-cp37-cp37m-win_amd64.whl (438.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyhepmc-2.6.0-cp37-cp37m-win32.whl (373.3 kB view details)

Uploaded CPython 3.7m Windows x86

pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (517.5 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (538.8 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

pyhepmc-2.6.0-cp37-cp37m-macosx_10_9_x86_64.whl (502.3 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file pyhepmc-2.6.0.tar.gz.

File metadata

  • Download URL: pyhepmc-2.6.0.tar.gz
  • Upload date:
  • Size: 453.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0.tar.gz
Algorithm Hash digest
SHA256 085122b2a7cddb0147abcc0b87881f54efe6e57d283b4a7d39bc17f0865d39c8
MD5 dea16a696177b09534bd431d26a300c4
BLAKE2b-256 f3c639d94df560d8487f74db18d707855295b241b2b860a28be985e6018a0069

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 440.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8cf17880fae9116919c506ec52f0d651235620c24dda76a88527cd45c8550505
MD5 a375d60107801be3dec6cd17887f443b
BLAKE2b-256 c5c362cc630cd87bed4d8cbfe6b64a73378401e1b253a7bd80d1195eb0679b3d

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4cf03f0328af9b98df12894f79a94aee3e37c1a8927159fcdc90e5ddf6cb06f0
MD5 99025607b280b6d7f259c84de4bf6faf
BLAKE2b-256 866971a023872833988a7d56d3b07123a166127ebb3b98df67c09be7329b6b56

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e6dd8c7599eca333e6037f0f731f5a35bf4d5790c36cb2fad9419b608afd49fe
MD5 054e964c5dcb346c8b192c391c759dce
BLAKE2b-256 556c794c262684a581a99ac55568804b68bf86b414475d1a160dd3b9125a6d78

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b434f555c24c58b93e0312f9c0571cf7179ebac6251538343354c5ba134e9857
MD5 bcd5f60d780acf04bb3b305505eea527
BLAKE2b-256 c6f585ad1663637a110eebfaaa567700b5734e1b280da2aabf6941f05bb01e7f

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 440.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 49eaeb06bdf7598e342525d6648db91ca85c3644f94b322ba6307763b190e362
MD5 b6f2715bd28329ce8bac3ed551df6228
BLAKE2b-256 93270438107a359ab44f38e0400ef1d1187a93d9e3a1838f69df0dec2a444237

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 371.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 cde3d7cea8b26aaa6e8d9fc8d45367da4136ad59f8413322300cac125524c57b
MD5 dd4670ed6af1594494d6433d91537ba1
BLAKE2b-256 c7dcd9f9b8212ddd45f54b6c96f94e98590b5d54b5719b993b68a9044d5c7ce0

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 0ebbf9064d494ce997cb8ceca7ce69e827fedff9a30669f4749134bdeccca9f2
MD5 ec8c92826b32f4a8a456784f06f1a4a2
BLAKE2b-256 eb43e7d180206c12efb127ad08658ba922fb79defbcd2262d0419523708b72e0

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 b8da517820e78183c06a7d9e4cde43f9b6f8e2a01c07dbf328ec061ba13dc459
MD5 0e21fbd14e0868f0be7b2eec42272c58
BLAKE2b-256 cbaac3ecaa3ad8bcf19ef0b197d1ede594f29eb78d9196712875c5dd5e638616

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0a614899cfa95c89f45ac78a7fd7637a2d611d29de316e4e0ac88b4947ac02cd
MD5 517c00b9120a86fd21957dfbdaaa7501
BLAKE2b-256 125d21f6a48da1fd09abd1e82be8ef3a5b21af5365274cb8415cb3354810fe60

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d78437742d46c954dd2402a92771c53a7e8c28ffe1a7f05a1de7ebb2dabeab26
MD5 1a007c4671d4a729d8e480b01a38b08b
BLAKE2b-256 1f41b77e58c4ee1d2cc226e5b6e36401614e4166160782c4eb90c326f6c7d6e2

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 440.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 94a233348c7dcc905216212a27fa7191e163311e4a09d834a2117811fd5d0590
MD5 8aab36fc7a9c9af9902258f7966cf919
BLAKE2b-256 8c7d4737d1487762eda54e2a60c57e6efcd00337685d7bf3ef26aac69eefc486

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 371.3 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 fb95bd945952b84bfadc257e5325dac179424b442588036e1cda8f0a1e54c17c
MD5 9f52980d80dc480740810b66b29bf284
BLAKE2b-256 236697e7054a95d00646f8475906fd5eb5cd4d7c10c7fdcd9f7f1bc92c46b2a1

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 5140575241f48aa90772467e8d799e02ec16c4ea3169f8bf0e342e75a4b2163e
MD5 15afb332ad726045a95b43920fb98647
BLAKE2b-256 8c55808cc545d98e74ace7d397e5d7088e6a4aa74aea1326f5faa56a5811ecbd

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 c99c41bafe67d45a2b7043a32b76c4b90847f1c87c4c925b88fa795dc23e136c
MD5 449edaf65721b0302d9c67f7c59b8f9d
BLAKE2b-256 58b5f3f4deca8918a765ef999e8cf62eaa012cd92a004f5395a9e7dcd7e88bde

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d48c7960d4deb94687fe57f2fbd918df993b561a2e3fe7d469b897331c17487e
MD5 cae14b9938e44fd66725a25530e24627
BLAKE2b-256 4e682d9a5ed2adfa577775f8218936d939c9d20a73419056a0ed7cba44566131

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1124c0a2652ed2755aead31d7bf44010f3bcac23cbd7c019f9917dfe843079a0
MD5 6ca379d8011bff234425d69598a6a912
BLAKE2b-256 88c1e81932127303280e0786f0d431bc4254eb52badb373b16179a04df588aca

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 438.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d3702feb050e774ffb1ba9d4f0f2457bcf8009adaf3f5abfdd96f57bb91810e6
MD5 fe217764ab96add98dae372cdda7f553
BLAKE2b-256 1d94371a3e01f1ccacbaa9ad87e43ccff853e08fcecaad8ce748dadf26abd633

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pyhepmc-2.6.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 373.3 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyhepmc-2.6.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 e86fdb2d8a157ef47e3241cc2a79c7961ba32654d3b90fc8cc524ec6ad605816
MD5 c12782bd7d18ba115326cd001e920435
BLAKE2b-256 8c16ef6e4f1eb95211d5d2b994459a4593eebc308c676f68a69392de44c8754c

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f31fd95223c02dc86ec5dd760d2ce3739a80624630be6400a0a2a16fce31dff7
MD5 52ed5ec48ccb88418abe43bff7489537
BLAKE2b-256 092083088e830476064f549a6e3ace19ab80e18c7a0f73a98e5c2e1312fff7d2

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 0316381bd8f588018cbd82c077b1d49ec3044e57ad84823f599593508c6f752b
MD5 c38942707a56d55c83fe25c92e258713
BLAKE2b-256 b5503e8ff8b17ac6d248bbb28805a007ed5f470ff69faced252c68c03ddd1713

See more details on using hashes here.

File details

Details for the file pyhepmc-2.6.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.6.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cb5c9a711384f5805c4cd1266eb71b0a97e30d0424ec8170251384a7f92ce731
MD5 b7700c75da96c7e77f72fd3e9b046a38
BLAKE2b-256 2263b11b53078dd30428fbd02355e62053a694d2f2886f4ead801a9500484d4f

See more details on using hashes here.

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