Skip to main content
# particlespell

A lightweight, PDG-powered particle data tool with multi-variant name support and real-time data synchronization.

## Overview
particlespell simplifies particle property retrieval by unifying local fast lookup and PDG's authoritative API. It natively supports multiple particle name variants (LaTeX, EvtGen, Unicode, etc.) and automatically fetches updated data from PDG, making particle physics data access intuitive and efficient.

## Installation
Requires Python 3.9+:
```bash
pip install particlespell

Quick Start

from particlespell import Particle

# 1. Query by name (supports multiple variants)
p = Particle(name="π⁺")  # Or "pi+", "\\pi^+", "pi_plus", "π<sup>+</sup>"
print(f"Mass: {p.mass} ± {p.mass_err} MeV/c²")
print(f"Lifetime: {p.lifetime} s")
print(f"Quantum J/P: {p.quantum_J}/{p.quantum_P}")

# 2. Query by PDG MCID
p_proton = Particle(mcid=2212)
print(f"Name: {p_proton.name}, Charge: {p_proton.charge}")

# 3. Access decay properties
print("Top 2 branching fractions:")
for bf in p.branching_fractions[:2]:
    print('%-60s    %4s    %s' % (
        bf.get('description', ''),
        bf.get('is_limit', ''),
        bf.get('value', '')
    ))

Core Features

  • Multi-Variant Name Compatibility: Seamlessly match particles by standard name, LaTeX, EvtGen, HTML, Unicode, or custom aliases.
  • Comprehensive Particle Properties: Retrieve mass, lifetime, charge, branching fractions, quantum numbers (J/P/C/I/G), and particle type flags (baryon/meson/lepton/etc.).
  • PDG Data Synchronization: Automatically supplements local data with up-to-date PDG API results, with built-in caching to avoid redundant requests.
  • Dual Query Modes: Look up particles by name (flexible) or PDG MCID (precise).
  • Robust Fallback: Retains local data access even if PDG API is unavailable.

Key Properties

Category Properties
Basic Info name, mcid, programmatic_name, latex_name, evtgen_name
Dynamic Data mass/mass_err, lifetime/lifetime_err, width/width_err
Decay Data branching_fractions, inclusive_branching_fractions, exclusive_branching_fractions
Classification charge, is_baryon, is_meson, is_lepton, is_boson, is_quark
Quantum Numbers quantum_J, quantum_P, quantum_C, quantum_I, quantum_G

Dependencies

  • pdg >= 0.1.4 (PDG official API client)
  • particle >= 0.25.3 (particle name variant support)
  • Python 3.12+

Contributors

License

Copyright (c) 2025 Zhang Bolun, Liao Yipu

This project is licensed under the MIT License — see the LICENSE file for full details.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Metadata

Release files for particlespell 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for particlespell 0.0.3
File Size Uploaded
particlespell-0.0.3.tar.gz 37.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for particlespell 0.0.3
File Interpreter ABI Platform
particlespell-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 76.4 kB

Release files / particlespell-0.0.3.tar.gz

Download URL particlespell-0.0.3.tar.gz
Size 37.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6d90028fc150dc75fec3ff1814d59fb89b6667521e71ee9e85a8ea0f8350b0f3
BLAKE2b-256 checksum
How to use checksums
9cd96ca5d54b6047ec1af379a65060d0d5cb32dbc163988410f449b56bb99ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / particlespell-0.0.3-py3-none-any.whl

Download URL particlespell-0.0.3-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4592ad42a9ff953d59e0b6949e8dec49cd3f5718a52b9907f64c138708b8a15f
BLAKE2b-256 checksum
How to use checksums
fe1ce295bd110c9297c607cddbf0934d88e51ad821f560903ee80e97410a7746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page