Skip to content

feat(bindings): dvb-si-py — PyO3/maturin Python bindings (#66) - #274

Merged
fishloa merged 2 commits into
mainfrom
story/66-python-bindings
Jun 20, 2026
Merged

fishloa merged 2 commits into
mainfrom
story/66-python-bindings

Conversation

@fishloa

@fishloa fishloa commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Read-only Python bindings over dvb-si/dvb-t2mi — the demand-gated story (Extensions report §5.3), now ungated on your go.

API

  • parse_section(bytes) -> dict — parse one SI/PSI section into a Python dict.
  • Demux() (wraps SiDemux) + T2miDemux(pid) (wraps T2miPump) — feed(packet) -> list[dict].
  • Parsed structs convert Rust → serde_json → Python objects (read-only by design — leans on the crates' Serialize-only serde posture; keys mirror the Rust API, camelCase).
  • abi3 wheel (CPython ≥ 3.9) via PyO3 0.24 + maturin; module dvb_si_py.

Decoupled by design

Lives in bindings/python/, outside the Rust workspace (PyO3 MSRV > workspace 1.81) — consumes the published dvb-si/dvb-t2mi 7.6 crates by version, not path. Core crates untouched.

CI (python-bindings.yml)

  • PR (touching bindings/**): maturin develop + pytest.
  • dvb-si-py-v* tag: build wheels (linux/macos/windows) + publish to PyPI (--skip-existing, PYPI_API_TOKEN). Wheels are the only Python artifact, CI-only.

Validated

maturin develop builds the wheel; 3 pytest tests pass, decoding 237 real sections (PAT/PMT/SDT/NIT/EIT) off the committed tnt capture from Python.

Closes #66

🤖 Generated with Claude Code

fishloa added 2 commits June 20, 2026 16:16
Read-only Python bindings over dvb-si/dvb-t2mi (Extensions report §5.3, now
ungated):
- parse_section(bytes) -> dict; Demux (SiDemux) + T2miDemux (T2miPump) classes
  with feed(packet) -> list[dict]. Parsed structs convert Rust → serde_json →
  Python objects, leaning on the crates' Serialize-only serde posture (read-only
  by design — parse, don't build).
- abi3 wheel (CPython >=3.9) via PyO3 0.24 + maturin; module dvb_si_py.

Lives in bindings/python/, OUTSIDE the Rust workspace (PyO3 MSRV moves faster
than the workspace 1.81) — consumes the published dvb-si/dvb-t2mi crates by
version (7.6), not path. Own CI workflow (python-bindings.yml): maturin develop
+ pytest on PR; build wheels (linux/macos/windows) + publish to PyPI on a
dvb-si-py-v* tag (artifacts only from CI).

Validated: maturin develop builds the wheel + 3 pytest tests pass, decoding 237
real sections (PAT/PMT/SDT/NIT/EIT) off the tnt capture from Python.

Closes #66
@fishloa
fishloa merged commit e23a82f into main Jun 20, 2026
9 checks passed
@fishloa
fishloa deleted the story/66-python-bindings branch June 20, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Python bindings (dvb-si-py via PyO3/maturin) — demand-gated

1 participant