Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.topics.topic_schema

Module Contents

TopicSchema

class roboto.domain.topics.topic_schema.TopicSchema(record, fields, roboto_client)#View Source

Describes the field structure of a topic’s messages.

A topic schema is identified by a name (e.g., "sensor_msgs/Imu") and a content-based checksum deterministically derived from its fields. Schemas are deduplicated within an organization: topics whose fields share the same names, paths, and data types reference the same schema.

Use from_id() when you already know the schema_id. Topic.get_schema() retrieves the schema associated with a specific topic.

Usage

Retrieve a schema and inspect its fields:

from roboto.domain.topics import TopicSchema
schema = TopicSchema.from_id("ts_abc123")
print(schema.name, schema.checksum)
for field in schema.fields:
    print(field.path_in_schema, field.data_type)

Properties

TopicSchema.checksum

checksum str #

Content-based checksum of the schema’s field set.

Return type: str

TopicSchema.fields

Field definitions belonging to this schema.

TopicSchema.from_id()

classmethod from_id(schema_id, roboto_client=None)#View Source

Retrieve a schema by its ID.

Parameters

schema_id str

Unique identifier of the schema to retrieve.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Returns

A TopicSchema for the given schema_id.

Raises

No schema with this ID exists.

Usage

from roboto.domain.topics import TopicSchema
schema = TopicSchema.from_id("ts_abc123")
for field in schema.fields:
    print(field.path_in_schema, field.data_type)

Properties

TopicSchema.name

name str | None #

Informational label for the schema (e.g. "sensor_msgs/Imu"). Not part of identity; may be None.

Return type: Optional[str]

TopicSchema.record

Underlying schema record.

TopicSchema.schema_id

schema_id str #

Unique identifier for this schema.

Return type: str

Was this page helpful?