pygemc is now available as a standalone package on PyPI.

Version 0.2.0 is the first stable, tagged release published to the Python Package Index. It can be installed without building GEMC from source, making it straightforward to use the Python geometry API, PyVista visualization, and output analyzer on any Python 3.10+ system.


Install from PyPI

Set up a virtual environment and install with pip:

python3 -m venv ~/venv/pygemc
source ~/venv/pygemc/bin/activate
python -m pip install pygemc

To include optional ROOT-file analysis support:

python -m pip install "pygemc[root]"


What pygemc provides

  • Geometry APIGVolume, GMaterial, and GConfiguration classes for building Geant4 detector databases in Python, with ASCII and SQLite output.
  • PyVista visualization — interactive 3D previews, a background Qt plotter, and VTK.js .vtksz scene export for embedding geometry in documentation.
  • gemc-system-template CLI — scaffold a new detector system from a Geant4 solid template with a single command.
  • gemc-analyzer CLI — read and plot GEMC CSV or ROOT output files by variable name, from the command line, Python scripts, or Jupyter notebooks.
  • Unit conversion helpers — length, angle, time, and energy string converters compatible with the Geant4 unit table.


Quickstart

Generate a detector skeleton and preview it:

gemc-system-template -s counter
cd counter
./counter.py -pv

Analyze simulation output:

gemc-analyzer counter_t0_digitized.csv totEdep --kind csv --bins 50


What changed in 0.2.0

This release focused on packaging, documentation, and CI — the geometry and analyzer APIs themselves are unchanged from v0.1.0.

  • Configured stable PyPI publishing with Hatch and hatch-vcs; version detection is restricted to vX.Y.Z tags so the moving dev snapshot is kept off PyPI.
  • Added a nightly GitHub dev prerelease workflow for users who need the latest development snapshot.
  • Added a publish_pypi.yml workflow for manual stable-tag publishing, with TestPyPI support.
  • Rewrote the README with a full feature overview, installation paths, quickstart, geometry API example, CLI reference, PyVista gallery, and project layout.
  • Added CI, Python, PyPI, license, and documentation badges.
  • Added governance documents: CODE_OF_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md.
  • Added Meson build-system integration so the parent GEMC build installs pygemc without unnecessary isolated-build PyPI fetches.
  • Reduced import-time cost by keeping heavy PyVista, Qt, and plotting imports lazy.

See the full release notes on GitHub.


Development snapshot

Users who need the latest unreleased changes can install the moving dev prerelease directly from GitHub:

python -m pip install "pygemc @ git+https://github.com/gemc/pygemc.git@dev"