Skip to main content

selene-formats for Python

Python models for the versioned, serializable Selene trace protocol. See the protocol documentation and JSON Schema in the repository's selene-formats/ directory.

from selene_formats.trace import (
    SCHEMA_VERSION,
    Trace,
    TraceData,
    Traces,
    parse_trace_json,
)

trace = Trace(schema_version=SCHEMA_VERSION, events=[])
traces = Traces(schema_version=SCHEMA_VERSION, traces=[TraceData(events=[])])
upgraded = parse_trace_json(versionless_trace_json)
legacy_json = trace.as_legacy().model_dump_json(indent=2)

as_legacy() returns a LegacyTrace sharing the current event models and validation rules. Its model_dump() and model_dump_json() omit schema_version and keep opaque tags numeric. LegacyTrace also accepts versionless input and defaults its internal version to 0.1.0. Filtering and timing helpers retain legacy serialization. Collections have no legacy format.

For trace streams, use the MessagePack API rather than the JSON document parser:

from selene_formats.trace_stream import iter_trace_stream, write_trace_stream

write_trace_stream("trace.msgpack.gz", trace.events)
for event in iter_trace_stream("trace.msgpack.gz"):
    print(event)

Use iter_trace_stream_records to include instruction metadata. Reads are lazy and uncached, so keep the source file available until iteration finishes. See the stream format for framing and error handling.

Metadata

Release files for selene-formats 0.1.2

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

Source distribution (sdist)

Source distribution for selene-formats 0.1.2
File Size Uploaded Provenance Actions
selene_formats-0.1.2.tar.gz 43.7 kB With provenance Details for selene_formats-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for selene-formats 0.1.2
File Interpreter ABI Platform Actions
selene_formats-0.1.2-py3-none-any.whl Python 3 none any Details for selene_formats-0.1.2-py3-none-any.whl

Total release size: 56.1 kB

Release files / selene_formats-0.1.2.tar.gz

Download URL selene_formats-0.1.2.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
310ab7d4227017527da87390f4df6f4a05cf79b6d44fe3046a943bb83205558f
BLAKE2b-256 checksum
How to use checksums
15be8f5956d40cb64e5285dc13b212539968bee96f9ed8cfe04f22955a7e5238
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 Oct 22, 2026.

Transparency log

Release files / selene_formats-0.1.2-py3-none-any.whl

Download URL selene_formats-0.1.2-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db983286daeffba04c2b85b86336ebed07bae37ba9f6695285e8dec889254c40
BLAKE2b-256 checksum
How to use checksums
8f5cdfe2bef457743929463ca34bc1bd2c47ae903efaafe79261403a7f52bef5
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 Oct 22, 2026.

Transparency log

Security for selene-formats 0.1.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for selene_formats-0.1.2.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 Oct 22, 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