Skip to main content

Mosaico Logo

PyPI version Python 3.10+ Apache 2.0 License

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 .Q proxy 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 .bag and ROS 2 .mcap/.db3 files 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 pandas DataFrames 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. You can run them using the mosaicolabs.examples command:

# List all available examples and help
mosaicolabs.examples --help

# Run a specific example
mosaicolabs.examples ros_injection

Available Examples:

  • ros_injection: Demonstrates downloading a sample dataset and ingesting it. Run this first — the other examples query the data it ingests.
  • reconstruct_rosbags: Reconstructs the ingested rosbag.
  • data_inspection: Shows how to list sequences and inspect topic metadata.
  • query_catalogs: Advanced querying based on ontology tags and sensor values.
  • mujoco_vis: Advanced querying and result visualization.

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.8.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 mosaicolabs 0.8.0
File Size Uploaded Provenance Actions
mosaicolabs-0.8.0.tar.gz 419.2 kB With provenance Details for mosaicolabs-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mosaicolabs 0.8.0
File Interpreter ABI Platform Actions
mosaicolabs-0.8.0-py3-none-any.whl Python 3 none any Details for mosaicolabs-0.8.0-py3-none-any.whl

Total release size: 962.1 kB

Release files / mosaicolabs-0.8.0.tar.gz

Download URL mosaicolabs-0.8.0.tar.gz
Size 419.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5bd4db41f8bd7dd851a53ad540e7a62d6fbc606262e740d315c84e452a7fec85
BLAKE2b-256 checksum
How to use checksums
56c9758dd07200f4ecc18bf6987e4ddf08d4686e44c102a4aa4a0308e16e27c0
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 23, 2026.

Transparency log

Release files / mosaicolabs-0.8.0-py3-none-any.whl

Download URL mosaicolabs-0.8.0-py3-none-any.whl
Size 542.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ca9dc7e6b7a63a5d6f295c59491eb139f0387bd4938a070ea2948b0f1294739
BLAKE2b-256 checksum
How to use checksums
eaeb57bd42cebfe639acf1938c0476e8bac4b38814d50e46a6ae5702106214c0
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 23, 2026.

Transparency log

Security for mosaicolabs 0.8.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.

Select from 2 files

Attestation for mosaicolabs-0.8.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 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.

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