Skip to main content

beamio

Read, write, and convert acquired or modelled radiotherapy beam measurements using a shared NumPy-based data model.

Supported formats

Format Read Write Automatic detection
IBA myQA Accept 6 ASCII (.asc) Yes Yes Yes
RayStation 2025+ measured-curves CSV (.csv, semicolon-delimited) Yes Yes No; use Raystation directly

PTW BEAMSCAN/Mephysto (.mcc) and SNC SunSCAN 3D (.snctxt) are planned and are not implemented in this release.

Installation

Requires Python 3.12 or newer. NumPy is installed automatically.

python -m pip install beamio

Read and convert beam data

from beamio.rfa import BeamDataFactory, IBAAccept6
from beamio.tps.raystation import Raystation

# Detect and parse an IBA Accept ASCII file.
beam = BeamDataFactory.from_file("measurements.asc")
# Or select the reader explicitly:
# beam = IBAAccept6("measurements.asc").parse()

for measurement in beam.measurements:
    print(measurement.type, measurement.energy, measurement.field_size)
    print(measurement.positions, measurement.doses)

# Conversion copies measurements and metadata; save writes the target format.
converted = beam.convert(Raystation)
converted.save("measured_curves.csv")

# RayStation CSV files use the explicit reader.
curves = Raystation("measured_curves.csv").parse()

BeamData provides parse(), save(), and convert(). Each Measurement contains NumPy positions and doses arrays, a MeasurementType, a RadiationType, energy, SSD, field size, scan endpoints, and a metadata dictionary. The shared spatial fields use millimetres. Dose values retain the input scale; conversion does not normalize or calibrate them.

Conversion transfers the shared model and copies metadata, but format-specific writers may use defaults or omit unsupported metadata. In particular, the RayStation writer generates its default file header (including an export time) rather than preserving the input header. IBA parsing removes non-finite sample pairs, sorts and deduplicates positions, and rounds start coordinates to 0.2 mm with values within 0.2 mm of zero set to zero. IBA output rounds coordinates to 0.1 mm. These operations mean that a save is not a byte-for-byte round trip.

Development

python -m venv .venv

Activate the environment with .venv\Scripts\Activate.ps1 in PowerShell or source .venv/bin/activate on macOS/Linux, then run:

python -m pip install -e ".[dev]"
python -m pytest
python -m build
python -m twine check --strict dist/*
python tools/check_dist.py

The tests generate synthetic measurements in temporary directories. CI tests the installed wheel on Linux, Windows, and macOS and rebuilds the wheel from the source distribution. Tests follow the source areas they exercise, with complete conversions under tests/integration.

beamio uses Conventional Commits and Python Semantic Release. Changes merged to main pass CI before automatic versioning, release-note generation, GitHub releases, and PyPI publishing. pyproject.toml is the version source; beamio.__version__ reads the installed distribution metadata.

Documentation

License

GNU General Public License version 2 only (GPL-2.0-only); see LICENSE.

Metadata

Release files for beamio 0.1.1

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

Source distribution (sdist)

Source distribution for beamio 0.1.1
File Size Uploaded Provenance Actions
beamio-0.1.1.tar.gz 39.4 kB With provenance Details for beamio-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 63.3 kB

Release files / beamio-0.1.1.tar.gz

Download URL beamio-0.1.1.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7395f47ff41bdf20e70f991470a9004521bb6b974b620f2064b3aff87d75fc6a
BLAKE2b-256 checksum
How to use checksums
4a02120344fd3095cd4a7c288c227c8d9191c91b398af88611766b0ddfe054b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / beamio-0.1.1-py3-none-any.whl

Download URL beamio-0.1.1-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1b653f85e4fcd36a432108d2d1f610e15c312602f46bfac70bd7c7afd5357ef
BLAKE2b-256 checksum
How to use checksums
c919815668182498ac057c38431e0582b1278c209553f83ecac18253297fe088
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for beamio 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for beamio-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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