Mosaico SDK
The Mosaico SDK is the primary Python interface for the Mosaico Data Platform, a high-performance system for ingesting, storing, and querying multi-modal robotics data (Physical AI, Robotics, IoT, and Computer Vision).
It treats robotics data as a first-class citizen instead of a bag of generic numbers: sensor streams are validated, typed, time-synchronized, and queryable — down to the physical value level (e.g. "find every sequence where lateral acceleration exceeded 4 m/s²").
For full documentation, see the Mosaico Python SDK Documentation.
Key Features
- Typed Ontology — Pydantic models for common sensors (IMU, GPS, Camera, LiDAR, Point Clouds, ...) with an automatically derived Apache Arrow schema, and a fluent
.Qproxy for type-safe queries directly on model fields (IMU.Q.acceleration.x.gt(9.8)). - High-Performance I/O — zero-copy Arrow transport, batched streaming, and optional gRPC compression, so datasets far larger than RAM can be pushed and pulled efficiently.
- Deep Querying — search across sequence/topic metadata and the physical content of sensor streams in a single request, with built-in temporal clustering and cross-sensor correlation.
- ROS Bridge — ingest ROS 1
.bagand ROS 2.mcap/.db3files out of the box, with adapters for common message types and a clean extension path for custom/proprietary ones. - ML-Ready — flatten nested sensor data into
pandasDataFrames and resample multi-rate sensors onto a uniform time grid for model training. - Secure by Default — one-way/two-way TLS and API-key authentication are first-class options on every connection.
Installation
Install the SDK via pip:
pip install mosaicolabs
Requires Python 3.10 or higher.
Infrastructure Prerequisite
Before running any Mosaico service via the SDK, ensure your Mosaico Infrastructure is active and running. The easiest way is to follow the installation guide.
from mosaicolabs import MosaicoClient
# Connect to the Mosaico server
with MosaicoClient.connect(host="localhost", port=6726) as client:
# Simple is-alive check
print(client.version())
Quick Start
Reading Data
from mosaicolabs import MosaicoClient
with MosaicoClient.connect(host="localhost", port=6726) as client:
# List available sequences
sequences = client.list_sequences()
print(f"Connected! Found sequences: {sequences}")
# Get a handle for a specific sequence
if sequences:
handler = client.sequence_handler(sequences[0])
print(f"- Topics: {handler.topics}")
print(f"- Created: {handler.created_timestamp}")
print(f"- Updated: {handler.updated_timestamps}")
Ingesting Data
from mosaicolabs import MosaicoClient, Message, IMU, Vector3d
with MosaicoClient.connect(host="localhost", port=6726) as client:
# A `with` block ensures buffers are flushed and the sequence is
# committed on exit, even if the code inside raises.
with client.sequence_create(sequence_name="demo_run") as seq_writer:
imu_writer = seq_writer.topic_create(
topic_name="sensors/imu",
ontology_type=IMU,
)
imu_writer.push(
message=Message(
timestamp_ns=1_700_000_000_000_000_000,
data=IMU(
acceleration=Vector3d(x=0.1, y=0.0, z=9.81),
angular_velocity=Vector3d(x=0.0, y=0.0, z=0.0),
),
)
)
Querying Data
from mosaicolabs import MosaicoClient, QueryOntologyCatalog, IMU
with MosaicoClient.connect(host="localhost", port=6726) as client:
# Find every sequence where the IMU registered a hard vertical impact
qresponse = client.query(
QueryOntologyCatalog().with_expression(IMU.Q.acceleration.z.gt(15.0))
)
if qresponse is not None:
for item in qresponse:
print(f"Sequence: {item.sequence.name}")
print(f"Topics: {[topic.name for topic in item.topics]}")
Command Line
Install the mosaico CLI with pip install "mosaicolabs[cli]", set up a connection profile (mosaico profile add dev), then move ROS bags and MCAP files in and out of the platform:
# Inject a ROS bag (MCAP, db3 or legacy .bag) or an MCAP file into a new sequence
mosaico inject ros path/to/your/data.mcap --name my_test_run
mosaico inject mcap path/to/your/data.mcap --name my_test_run
# Extract a sequence back to a ROS bag or an MCAP file
mosaico extract ros my_test_run --rosbag-path ./exports
mosaico extract mcap my_test_run --mcap-path ./exports
Interactive Examples
We provide pre-built examples to help you explore the SDK capabilities. They run through the mosaico CLI and connect to the server of your active connection profile, so install the CLI and create a profile first (see Command Line):
pip install "mosaicolabs[cli]"
mosaico profile add dev
# List all available examples
mosaico examples ls
# Run a specific example
mosaico examples ros_injection
The older mosaicolabs.examples script still works but is deprecated.
Available Examples:
ros_injection: Downloads a sample ROS bag and ingests it. Run this first: the ROS and query examples read the data it ingests.reconstruct_rosbags: Rebuilds ROS bags from the sequences written byros_injection.mcap_injection: Downloads a sample MCAP file and ingests it.reconstruct_mcaps: Rebuilds MCAP files from the sequences written bymcap_injection.data_inspection: Lists the sequences in the catalog and inspects their topics.query_catalogs: Advanced querying based on ontology tags and sensor values.mujoco_vis: Retrieves a UR robot sequence, plots its joints and replays it in MuJoCo (requirespip install mujoco).
The
mosaicolabs.examplesscript, with its--host/--port/--tls/--api-keyoptions, is deprecated and will be removed in a future release.
Documentation
| Topic | Description |
|---|---|
| Client | Connecting to the platform: TLS, API-key auth, compression. |
| Ontology | Typed data models, custom ontologies, and the .Q query proxy. |
| Data Handling | Writing and reading sequences and topics. |
| Query | The full query DSL, temporal windows, and query chaining. |
| ROS Bridge | Ingesting ROS 1/ROS 2 bags and writing custom adapters. |
Changelog
See CHANGELOG.md for release notes.
Contributing
We welcome contributions! Please refer to our Development Guide for instructions on how to set up your environment using uv.
License
This project is licensed under the Apache-2.0 license.
Metadata
Release files for mosaicolabs 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mosaicolabs-0.9.0.tar.gz | 473.5 kB | With provenance | Details for mosaicolabs-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mosaicolabs-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for mosaicolabs-0.9.0-py3-none-any.whl |
Total release size: 1.1 MB
Release files / mosaicolabs-0.9.0.tar.gz
| Download URL | mosaicolabs-0.9.0.tar.gz |
|---|---|
| Size | 473.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94071f7a6c01f789beb036aef408c50d8055676ed8233ba5721472dcac80b8d4
|
|
BLAKE2b-256 checksum How to use checksums |
b0c5743a9005f48d7cf42f657dfebb7d164076af0d4cd1c41d28163c14f3b621
|
| 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 26, 2026.
Transparency logRelease files / mosaicolabs-0.9.0-py3-none-any.whl
| Download URL | mosaicolabs-0.9.0-py3-none-any.whl |
|---|---|
| Size | 610.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c28415cbf5700171e717781fdb6e1fcaa393a0bbe090204d75dfb29a541e4a5
|
|
BLAKE2b-256 checksum How to use checksums |
4011c3930bf56a70db26d0db6075dd624347f43922f93fbc7c3648c59224511d
|
| 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 26, 2026.
Transparency logSecurity for mosaicolabs 0.9.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
Both files in this release have been uploaded with provenance metadata.
Attestation for mosaicolabs-0.9.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 Nov 26, 2026.
Transparency logA 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.