Skip to main content

Command-line tool to get the name of a particle given its PDGID (and vice versa).

Project description

pdgid

A command-line tool to quickly get a particle's name from its PDGID and vice versa.

All elementary SM particles are included as well as some (hopefully) relevant hadrons and BSM particles. The data was sourced from a combination of the PDG 2020 review, the CERN twiki, and rivet.

If you want additional particles added, extra features or find a bug, please submit an MR or create a issue! I am waiting to see if this package gains traction.

Installation

pip install pdgid

pdgid has no dependencies so you are free to install it outside of a virtual environment and not worry about package conflicts.

Requires python3.6 or higher.

Usage

Pass the command an id to get the associated particle name:

> pdgid 14
ν_μ

Or pass a particle name to get the associated id:

> pdgid ν_μ
14 [ν_μ]

Note the particle name can often be written in many forms and unicode is accepted (e.g. "nu_mu", "Vμ", "ν_μ", "muon neutrino", etc...). The name that's been matched is displayed in the square brackets to help with cases of ambiguity.

Finally, when ran without arguments the tool will print a table of all the particles it knows (along with their id).

Limitations

Searching by name doesn't support using "bar" to represent antiparticle.

Order matters for particles with multiple super/subscripts. This could be fixed with even more regex.

License

MIT

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

pdgid-0.1.2.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

pdgid-0.1.2-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

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