# Generic MoQ core (Python)

> An independently buildable package for MOQT sessions and arbitrary track objects. It has no runtime dependencies and does not import Relay product code or any transport library.

URL: https://www.caprid.com/docs/sdks/python/moq-core/
Source: https://github.com/caprids/relay-sdks/blob/main/python/packages/moq-core/README.md

An independently buildable package for MOQT sessions and arbitrary track objects. It has no runtime
dependencies and does not import Relay product code or any transport library.

`create_moqt_session` owns a supplied, established transport. Subscribe, fetch, and track-status
requests use callback handlers, preserve uninterpreted payloads and object properties, and expose
protocol lifecycle notifications. `MoqTrackSource` describes borrowed track access without shutdown.

`create_moqt_publish_session` serves a namespace and its registered tracks over a separate
transport. Track properties are explicit, with no default media timescale. `create_subgroup_writer`
writes arbitrary object payloads and metadata. The Relay SDK adds the bounded, single-object-group
publishing policy on top.

The transport interface is `moq_core.transport.MoqtTransport`, the part of a WebTransport session
the drivers need, spelled for asyncio. `caprid_relay` supplies the aioquic implementation, and tests
supply in-memory pairs.

This package follows MOQT draft 22, and draft 20 for a peer that selects it. It receives
subscription objects over reliable streams. It does not implement application timing, decoding,
datagram reception, or automatic session recovery.

The implementation is a port of `ts/packages/moq-core`, which is itself an attributed snapshot of the
Video.js protocol modules under Apache-2.0. See `NOTICE` and `UPSTREAM.json`.

To use Relay from an application, start with the [Python quickstart](https://github.com/caprids/relay-sdks/blob/main/python/README.md#first-round-trip).

The distribution on PyPI is `caprid-moq-core`, and the import name is `moq_core`.

## Stability

Before 1.0, a minor version can break the API. This package releases together with `caprid-relay` at
the same version. See the [changelog](https://github.com/caprids/relay-sdks/blob/main/python/CHANGELOG.md).
