{"id":5359,"library":"particle","title":"Particle","description":"Particle is a core library within the Scikit-HEP ecosystem, providing a Pythonic interface to the Particle Data Group (PDG) particle data tables and Monte Carlo (MC) identification codes. It offers extended particle information, identification queries via PDGID, and powerful search capabilities for particle properties. The library is under active development and frequently updated with new PDG data releases.","status":"active","version":"0.26.1","language":"en","source_language":"en","source_url":"https://github.com/scikit-hep/particle","tags":["physics","high-energy physics","PDG","particle data"],"install":[{"cmd":"pip install particle","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for data handling and internal data tables.","package":"pandas","optional":false},{"reason":"Provides classes without boilerplate, similar to Python's DataClasses.","package":"attrs","optional":false},{"reason":"Provides units for the Scikit-HEP packages, used for physical quantities.","package":"hepunits","optional":false}],"imports":[{"note":"Main class for interacting with PDG particle data.","symbol":"Particle","correct":"from particle import Particle"},{"note":"Class for querying properties of PDG identification numbers.","symbol":"PDGID","correct":"from particle import PDGID"},{"note":"Provides aliases for PDGID instances, e.g., `pdgid_literals.pi_plus`.","symbol":"pdgid.literals","correct":"import particle.pdgid.literals as pdgid_literals"},{"note":"Provides aliases for Particle instances, e.g., `particle_literals.phi_1020`.","symbol":"literals","correct":"import particle.literals as particle_literals"}],"quickstart":{"code":"from particle import PDGID, Particle\nfrom hepunits import GeV\n\n# Working with PDG IDs\npid_pion = PDGID(211)\nprint(f\"PDGID 211 is a meson: {pid_pion.is_meson}\")\n\n# Getting a Particle object from its PDG ID\npion = Particle.from_pdgid(211)\nprint(f\"Pion mass: {pion.mass / GeV:.3f} GeV\")\n\n# Searching for particles by properties\nneutral_beauty_hadrons = Particle.findall(lambda p: p.charge == 0 and p.has_bottom and p.mass > 5.2 * GeV and p.mass < 5.3 * GeV)\nfor p in neutral_beauty_hadrons:\n    print(f\"Found neutral beauty hadron: {p.name} (mass={p.mass / GeV:.3f} GeV)\")\n","lang":"python","description":"This quickstart demonstrates how to create `PDGID` and `Particle` objects, access their properties, and perform searches for particles based on specific criteria. It also shows the integration with `hepunits` for handling physical units."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. The current version (0.26.1) requires Python >=3.9.","message":"Python 3.7 and 3.8 support has been dropped in recent versions. Python 3.7 support was removed in v0.24.0, and Python 3.8 support was removed in v0.26.0.","severity":"breaking","affected_versions":">=0.24.0"},{"fix":"Consult the changelog or documentation for version 0.24.0 to identify and update any calls to removed methods.","message":"Deprecated methods were removed in version 0.24.0 of the library.","severity":"breaking","affected_versions":">=0.24.0"},{"fix":"If your analysis requires a specific older PDG data table, you may need to explicitly load it or use an older version of the `particle` library. Always be aware of which PDG data year is being used by default.","message":"The default PDG data table is updated annually with new releases (e.g., v0.26.0 defaults to 2025 data, v0.25.0 to 2024 data). Older superseded data files are removed.","severity":"gotcha","affected_versions":"All versions with yearly PDG updates"},{"fix":"Exercise caution when manually defining particles. Ensure that any custom PDG IDs are consistent with the standard PDG numbering scheme if you expect quantum numbers and other properties to be correctly inferred.","message":"When creating user-defined particles, assigning 'random' PDG IDs can result in particles with undefined or incorrect internal quantum numbers and properties.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}