Skip to main content

edgefirst-schemas (Python)

Zero-copy CDR message types for EdgeFirst Perception. Wraps the edgefirst-schemas Rust crate via PyO3.

pip install edgefirst-schemas

The wheel ships two stable-ABI families per OS/architecture:

  • cp311-abi3 — Python 3.11+, zero-copy Py_buffer path (pip prefers this on 3.11+)
  • cp38-abi3 — Python 3.8–3.10 (and 3.11+ if the other wheel is absent); constructors copy and BorrowedBuf.view() returns bytes

See abi3-py38 builds for the older-ABI tradeoffs.

Quick start

from edgefirst.schemas.builtin_interfaces import Time
from edgefirst.schemas.std_msgs import Header
from edgefirst.schemas.sensor_msgs import Image
import numpy as np

pixels = np.zeros((720, 1280, 3), dtype=np.uint8)
img = Image(
    header=Header(stamp=Time(sec=1, nanosec=0), frame_id="cam"),
    height=720, width=1280, encoding="rgb8",
    is_bigendian=0, step=1280 * 3,
    data=pixels,  # any contiguous buffer-protocol object
)

# Zero-copy view of the pixel data — `np.frombuffer` aliases the same
# bytes the message was constructed with, no copy.
arr = np.frombuffer(img.data, dtype=np.uint8).reshape(720, 1280, 3)

# Wire bytes for transport:
buf = img.to_bytes()
img2 = Image.from_cdr(buf)
assert img2.width == 1280

Forwarding raw CDR bytes without a copy

For publish paths where you want to hand the wire bytes straight to a transport (Zenoh, raw socket, mcap writer), cdr_view() exposes the full CDR buffer (header + payload) as a zero-copy BorrowedBuf:

transport.publish(memoryview(img.cdr_view()))   # zero-copy

to_bytes() is the explicit-copy alternative when the consumer wants an owned bytes value.

Zero-copy contract — BorrowedBuf

Every bulk byte payload (Image.data, Mask.mask, RadarCube.cube, PointCloud2.data, CompressedVideo.data, CompressedImage.data) returns a BorrowedBuf view that aliases the parent message's bytes — not a copy. The BorrowedBuf holds a strong reference to the parent, so it's safe to keep it (or a memoryview derived from it) live after the original message reference is dropped.

Method Returns Cost
borrowed_buf itself wraps the bytes zero-copy, O(1)
np.frombuffer(borrowed_buf, dtype=...) numpy ndarray aliasing the bytes zero-copy, O(1) (Py 3.11+)
memoryview(borrowed_buf) parent-anchored memoryview zero-copy, O(1) (Py 3.11+)
borrowed_buf.tobytes() owned bytes one memcpy
borrowed_buf.view() memoryview (Py 3.11+) / bytes (abi3-py38) zero-copy / one memcpy

Migrating from the pycdr2-backed edgefirst.schemas

This release replaces the pure-Python pycdr2 codec with a Rust-backed pyo3 binding. Wire-format bytes are unchanged — anything encoded by the previous pycdr2 module decodes through from_cdr() and vice-versa — but the Python API surface is narrower and stricter.

What changed at the call site

# pycdr2-backed (old)                    # pyo3-backed (new)
img = Image()                            img = Image(
img.height = 720                             header=Header(stamp=Time(1, 0)),
img.width = 1280                             height=720, width=1280,
img.encoding = "rgb8"                        encoding="rgb8", is_bigendian=0,
img.data = pixels                            step=1280 * 3, data=pixels,
buf = img.serialize()                    )
img2 = Image.deserialize(buf)            buf = img.to_bytes()
                                         img2 = Image.from_cdr(buf)
pycdr2 pattern pyo3 replacement
Foo() then field assignment Foo(field=value, …) constructor only — pyclasses are frozen
.serialize() .to_bytes()
Foo.deserialize(buf) Foo.from_cdr(buf)
msg.data returning bytes msg.data returning BorrowedBuf (zero-copy view); use .tobytes() for the old shape
from_schema(), decode_pcd(), colormap(), registry helpers removed — the legacy module survives only at benches/python/legacy/ for benchmark parity
std_msgs.{String, Int32, Float64, …} primitive wrappers removed — these were pycdr2-generated single-value wrappers; pass raw Python values instead
Mutable dataclass-style instances Frozen pyclasses; rebuild instead of mutate

What stays the same

  • All field names and types match the ROS 2 / Foxglove / EdgeFirst schemas verbatim.
  • Wire-format CDR1 LE bytes are byte-equivalent across versions.
  • The edgefirst.schemas.<submodule> import paths (sensor_msgs.Image, std_msgs.Header, etc.) are preserved.

abi3-py38 builds — typed numpy caveats

The default published wheel on Python 3.11+ is cp311-abi3, where the buffer protocol is in the limited API and typed numpy arrays (np.uint16, np.float32, …) work zero-copy as constructor inputs. On the cp38-abi3 wheel (Python 3.8–3.10, or a source build with --features abi3-py38) the buffer protocol isn't available; pass arr.tobytes() for typed arrays, and BorrowedBuf.view() returns bytes (one copy) instead of a parent-anchored memoryview. Plain bytes / bytearray / np.uint8 arrays work on either build.

shape = np.array([2, 128, 12, 128], dtype=np.uint16)

# Default cp311-abi3 wheel — works directly:
RadarCube(..., shape=shape, ...)

# abi3-py38 build — pass bytes:
RadarCube(..., shape=shape.tobytes(), ...)

Build from source

Default local develop (cp311-abi3, Python 3.11+ zero-copy):

maturin develop --release --manifest-path crates/python/Cargo.toml

cp38-abi3 wheel (Python 3.8+; copy-fallback on typed buffers):

maturin build --release \
  --manifest-path crates/python/Cargo.toml \
  --no-default-features --features abi3-py38

Cross-compile manylinux2014 wheels via zig:

maturin build --release --zig --compatibility manylinux2014 \
  --target aarch64-unknown-linux-gnu \
  --manifest-path crates/python/Cargo.toml

Metadata

Release files for edgefirst-schemas 4.1.0

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

Source distribution (sdist)

Source distribution for edgefirst-schemas 4.1.0
File Size Uploaded Provenance Actions
edgefirst_schemas-4.1.0.tar.gz 227.0 kB With provenance Details for edgefirst_schemas-4.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for edgefirst-schemas 4.1.0
File Actions
edgefirst_schemas-4.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for edgefirst_schemas-4.1.0-cp311-abi3-win_amd64.whl
edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
edgefirst_schemas-4.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for edgefirst_schemas-4.1.0-cp311-abi3-macosx_11_0_arm64.whl
edgefirst_schemas-4.1.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for edgefirst_schemas-4.1.0-cp311-abi3-macosx_10_12_x86_64.whl
edgefirst_schemas-4.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for edgefirst_schemas-4.1.0-cp38-abi3-win_amd64.whl
edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
edgefirst_schemas-4.1.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for edgefirst_schemas-4.1.0-cp38-abi3-macosx_11_0_arm64.whl
edgefirst_schemas-4.1.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for edgefirst_schemas-4.1.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 6.0 MB

Release files / edgefirst_schemas-4.1.0.tar.gz

Download URL edgefirst_schemas-4.1.0.tar.gz
Size 227.0 kB
Tags Source
SHA-256 checksum
How to use checksums
68016d8d77ee8f028c1f667ca351f8831be122de45e319d61f7340d379fac262
BLAKE2b-256 checksum
How to use checksums
94d0d87f5c319fb4f5db48143d6820b2970ff3422ae8aca182524630b34c719c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp311-abi3-win_amd64.whl

Download URL edgefirst_schemas-4.1.0-cp311-abi3-win_amd64.whl
Size 545.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c392da932f8d72ab868fdf6e19a1e5ff533e8b244077f111556b9c23ff08673d
BLAKE2b-256 checksum
How to use checksums
19a0bd729b29161c1f36d22da38bcb16dca98606f7e77b555bf3c0f45413bc9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 619.4 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e9d11f785cb39da08e9b29cb1ae7129e903e21b33ef826d100a64dbd62032643
BLAKE2b-256 checksum
How to use checksums
0cc7e5b3ed9157e98c04df50501f134efeb7854b30475373699a956a4f224d77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL edgefirst_schemas-4.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 587.2 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a7520ee68574919e2313a951e65735b78a2d29a07d834c25721b85cdee416ba9
BLAKE2b-256 checksum
How to use checksums
246e0c7445fbe81e469e506f4c3cc400711556ce1c7d0e5e48ae96069c0cb60f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL edgefirst_schemas-4.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 568.9 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b418507333f4190afdf66a6645e9d60257335169f91d02055aaefcd5335df95a
BLAKE2b-256 checksum
How to use checksums
30f746e29df935e14d1c57a8ca8c13e7fe09ae306343a3245a75ef9f6e1129e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL edgefirst_schemas-4.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 579.5 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f4dabc3614b2c7ec48f129b8d824665bab4685cecb0e917ffa251f92cbf93c08
BLAKE2b-256 checksum
How to use checksums
2b67dafab41f74a579bac23149e80c1878c47567706e45a0f5f42bc8664f3101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp38-abi3-win_amd64.whl

Download URL edgefirst_schemas-4.1.0-cp38-abi3-win_amd64.whl
Size 549.4 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
63484bcae473993974834519a16a11871ec634ea50157d233734b01273ca0a7f
BLAKE2b-256 checksum
How to use checksums
17d4df4d25a1a209060703cfa2f4b77167378a3749813cf07f7a63eda4d4c3ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 622.4 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bfc83cf87ae5f5cafe8f3bef09827d74af41acb8893af4297dd42f10755308a9
BLAKE2b-256 checksum
How to use checksums
1bffc1118471dbf05cdd760565f71680a374981659679da574636d97d3882cd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL edgefirst_schemas-4.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 589.1 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
89b97bacc310bb69fd946b4f988d6860e88afdbe7d4a9a0739ef4e0ef34e815f
BLAKE2b-256 checksum
How to use checksums
8b2f266239e5fccceade76e8c8e8d7aee20b21acac872b0064ac08a84a631056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL edgefirst_schemas-4.1.0-cp38-abi3-macosx_11_0_arm64.whl
Size 569.9 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
334a95027af616cd56186b6567bf9b7a4a48c75d34fd085acf5243e75b2aafe1
BLAKE2b-256 checksum
How to use checksums
ff8b8fa10e7029102847704876698cd24a963e2c5a4b08586e8c7584ccaf0c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Release files / edgefirst_schemas-4.1.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL edgefirst_schemas-4.1.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 579.9 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
34bf06122d369ffbcc2daa6e73d3342b9a99ce32e63f664697e265b89d0238f0
BLAKE2b-256 checksum
How to use checksums
88b08fa2e82a55fafc914e27b0eb69e0d45cdc9af8db3f341485b8657b424745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2026.

Transparency log

Security for edgefirst-schemas 4.1.0

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 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for edgefirst_schemas-4.1.0.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 23, 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.

Release history Release notifications | RSS feed

This release

4.1.0 This release

11 release files Full provenance

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