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

roboto.domain.topics

Submodules

Package Contents

AddMessagePathRepresentationRequest

class roboto.domain.topics.AddMessagePathRepresentationRequest(/, **data)#View Source

Bases: BaseAddRepresentationRequest

Request to associate a message path with a representation.

Creates a link between a specific message path and a data representation, enabling efficient access to individual fields within topic data.

Parameters

data Any

Attributes

AddMessagePathRepresentationRequest.message_path_id

message_path_id str #

AddMessagePathRepresentationRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

AddMessagePathRequest

class roboto.domain.topics.AddMessagePathRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request to add a new message path to a topic.

Defines a new message path within a topic’s schema, specifying its data type, canonical type, and initial metadata. Used during topic creation or when extending an existing topic’s schema.

Parameters

data Any

Attributes

AddMessagePathRequest.canonical_data_type

Normalized Roboto data type that enables specialized platform features for maps, images, timestamps, and other data.

AddMessagePathRequest.data_type

data_type str #

Native data type as it appears in the original data source (e.g., “float32”, “geometry_msgs/Pose”). Used for display purposes.

AddMessagePathRequest.message_path

message_path str #

Dot-delimited path to the attribute (e.g., “pose.position.x”).

AddMessagePathRequest.metadata

metadata dict[str, Any] = None #

Initial key-value pairs to associate with the message path.

AddMessagePathRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

AddMessagePathRequest.path_in_schema

path_in_schema list[str] = None #

List of path components representing the field’s location in the original data schema. Unlike message_path, which assumes dots separate path parts implying nested data, this preserves the exact path from the source data for accurate attribute access.

CanonicalDataType

class roboto.domain.topics.CanonicalDataType(*args, **kwds)#View Source

Bases: enum.Enum

Normalized data types used across different robotics frameworks.

Well-known and simplified data types that provide a common vocabulary for describing message path data types across different frameworks and technologies. These canonical types are primarily used for UI rendering decisions and cross-platform compatibility.

The canonical types abstract away framework-specific details while preserving the essential characteristics needed for data processing and visualization.

References

Example mappings:

  • float32 -> CanonicalDataType.Number
  • uint8[] -> CanonicalDataType.Array
  • sensor_msgs/Image -> CanonicalDataType.Image
  • geometry_msgs/Pose -> CanonicalDataType.Object
  • std_msgs/Header -> CanonicalDataType.Object
  • string -> CanonicalDataType.String
  • char -> CanonicalDataType.String
  • bool -> CanonicalDataType.Boolean
  • byte -> CanonicalDataType.Byte

Attributes

CanonicalDataType.Array

Array = 'array' #

A sequence of values.

CanonicalDataType.Boolean

Boolean = 'boolean' #

CanonicalDataType.Byte

Byte = 'byte' #

CanonicalDataType.Categorical

Categorical = 'categorical' #

Data that can take a limited, fixed set of values. To be interpreted correctly by Roboto clients, a MessagePathRecord with this type must have a "categories" metadata key on the MessagePathRecord, which must be the ordered list of values that the Categorical can take.

For example, a signal that is logged as either “off” or “on” could be represented as a Categorical with the metadata "categories"=["off", "on"]. This allows Roboto to map the value “off” to 0 and “on” to 1 –each corresponding to their index position in the metadata array– and therefore visualize these state transitions as a plot.

The default visual representation of Categorical data will be the same as String data, but the Roboto visualizer will be capable of rendering Categorical data in a plot.

CanonicalDataType.Image

Image = 'image' #

Special purpose type for data that can be rendered as an image.

CanonicalDataType.LatDegFloat

LatDegFloat = 'latdegfloat' #

Geographic point in degrees. E.g. 47.6749387 (used in ULog ver_data_format >= 2)

CanonicalDataType.LatDegInt

LatDegInt = 'latdegint' #

Geographic point in degrees, expressed as an integer. E.g. 317534036 (used in ULog ver_data_format < 2)

CanonicalDataType.LonDegFloat

LonDegFloat = 'londegfloat' #

Geographic point in degrees. E.g. 9.1445274 (used in ULog ver_data_format >= 2)

CanonicalDataType.LonDegInt

LonDegInt = 'londegint' #

Geographic point in degrees, expressed as an integer. E.g. 1199146398 (used in ULog ver_data_format < 2)

CanonicalDataType.Number

Number = 'number' #

CanonicalDataType.NumberArray

NumberArray = 'number_array' #

CanonicalDataType.Object

Object = 'object' #

A struct with attributes.

CanonicalDataType.String

String = 'string' #

CanonicalDataType.Timestamp

Timestamp = 'timestamp' #

Time elapsed since the Unix epoch, identifying a single instant on the time-line. Roboto clients will look for a "unit" metadata key on the MessagePath record, and will assume “ns” if none is found. If the timestamp is in a different unit, add the following metadata to the MessagePath record: { "unit": "s"|"ms"|"us"|"ns" } The unit must be a known value from TimeUnit.

CanonicalDataType.Unknown

Unknown = 'unknown' #

This is a fallback and should be used sparingly.

CreateTopicRequest

class roboto.domain.topics.CreateTopicRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request to create a new topic in the Roboto platform.

Contains all the information needed to register a topic found within a source recording file, including its schema, temporal boundaries, and initial message paths.

Parameters

data Any

Attributes

CreateTopicRequest.association

CreateTopicRequest.end_time

end_time int | None = None #

CreateTopicRequest.message_count

message_count int | None = None #

CreateTopicRequest.message_paths

message_paths collections.abc.Sequence[AddMessagePathRequest] | None = None #

CreateTopicRequest.metadata

metadata collections.abc.Mapping[str, Any] | None = None #

CreateTopicRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

CreateTopicRequest.schema_checksum

schema_checksum str | None = None #

CreateTopicRequest.schema_name

schema_name str | None = None #

CreateTopicRequest.start_time

start_time int | None = None #

CreateTopicRequest.topic_name

topic_name str #

DeleteMessagePathRequest

class roboto.domain.topics.DeleteMessagePathRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request to delete a message path from a topic.

Removes a message path from a topic’s schema. This operation cannot be undone and will remove all associated data and metadata for the specified path.

Parameters

data Any

Attributes

DeleteMessagePathRequest.message_path

message_path str #

Message path name.

DeleteMessagePathRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

MessagePath

class roboto.domain.topics.MessagePath(record, roboto_client=None, topic_data_service=None)#View Source

Represents a message path within a topic in the Roboto platform.

A message path defines a specific field or signal within a topic’s data schema, using dot notation to specify nested attributes. Message paths enable fine-grained access to individual data elements within time-series robotics data, supporting operations like statistical analysis, data filtering, and visualization.

Each message path has an associated data type (both native and canonical), metadata, and statistical information computed from the underlying data. Message paths are the fundamental building blocks for data analysis in Roboto, allowing users to work with specific signals or measurements from complex robotics data structures.

Message paths support temporal filtering, data export to various formats including pandas DataFrames, and integration with the broader Roboto analytics ecosystem. They provide efficient access to time-series data while maintaining the semantic structure of the original robotics messages.

The MessagePath class serves as the primary interface for accessing individual data signals within topics, providing methods for data retrieval, statistical analysis, and metadata management.

Attributes

MessagePath.DELIMITER

DELIMITER ClassVar = '.' #

Properties

MessagePath.canonical_data_type

Canonical Roboto data type corresponding to the native data type.

MessagePath.count

Number of data points available for this message path.

Return type: PreComputedStat

MessagePath.created

created datetime.datetime #

Timestamp when this message path was created.

Return type: datetime.datetime

MessagePath.created_by

created_by str #

Identifier of the user or system that created this message path.

Return type: str

MessagePath.data_type

data_type str #

Native data type for this message path, e.g. ‘float32’

Return type: str

MessagePath.from_id()

classmethod from_id(message_path_id, roboto_client=None, topic_data_service=None)#View Source

Retrieve a message path by its unique identifier.

Fetches a message path record from the Roboto platform using its unique ID. This is useful when you have a message path identifier from another operation.

Parameters

message_path_id str

Unique identifier for the message path.

roboto_client Optional[roboto.http.RobotoClient]

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

Service for accessing topic data. If None, creates a default instance.

Returns

MessagePath instance representing the requested message path.

Raises

Message path with the given ID does not exist.

Caller lacks permission to access the message path.

Usage

message_path = MessagePath.from_id("mp_abc123")
print(message_path.path)
# 'angular_velocity.x'
print(message_path.canonical_data_type)
# CanonicalDataType.Number

MessagePath.get_data()

get_data(start_time=None, end_time=None, cache_dir=None)#View Source

Return data for this specific message path.

Retrieves and yields data records containing only the values for this message path, with optional temporal filtering. This provides a focused view of a single signal or field within the broader topic data.

Parameters

start_time Optional[roboto.time.Time]

Start time (inclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

end_time Optional[roboto.time.Time]

End time (exclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

cache_dir Union[str, pathlib.Path, None]

Directory where topic data will be downloaded if necessary. Defaults to DEFAULT_CACHE_DIR.

Yields

Dictionary records containing the log_time and the value for this message path.

Return type

collections.abc.Generator[tuple[roboto.domain.topics.topic_reader.Timestamp, dict[str, Any]], None, None]

Notes

For each example below, assume the following is a sample datum record that can be found in this message path’s associated topic:

{
    "angular_velocity": {
        "x": <uint32>,
        "y": <uint32>,
        "z": <uint32>
    },
    "orientation": {
        "x": <uint32>,
        "y": <uint32>,
        "z": <uint32>,
        "w": <uint32>
    }
}

Usage

Print all data for a specific message path:

topic = Topic.from_name_and_file("/imu/data", "file_abc123")
angular_velocity_x = topic.get_message_path("angular_velocity.x")
for record in angular_velocity_x.get_data():
    print(f"Time: {record['log_time']}, Value: {record['angular_velocity']['x']}")

Get data within a time range:

for record in angular_velocity_x.get_data(start_time=1722870127699468923, end_time=1722870127799468923):
    print(record)

Collect data into a dataframe (requires installing the roboto[analytics] extra):

df = angular_velocity_x.get_data_as_df()
import math
assert math.isclose(angular_velocity_x.mean, df[angular_velocity_x.path].mean())

MessagePath.get_data_as_df()

get_data_as_df(start_time=None, end_time=None, cache_dir=None)#View Source

Return this message path’s data as a pandas DataFrame.

Retrieves message path data and converts it to a pandas DataFrame for analysis and visualization. The DataFrame is indexed by log time and contains a column for this message path’s values.

Parameters

start_time Optional[roboto.time.Time]

Start time (inclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

end_time Optional[roboto.time.Time]

End time (exclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

cache_dir Union[str, pathlib.Path, None]

Directory where topic data will be downloaded if necessary. Defaults to DEFAULT_CACHE_DIR.

Returns

pandas.DataFrame

pandas DataFrame containing the message path data, indexed by log time.

Raises

ImportError

pandas is not installed. Install with roboto[analytics] extra.

Notes

Requires installing this package using the roboto[analytics] extra.

Usage

topic = Topic.from_name_and_file("/imu/data", "file_abc123")
angular_velocity_x = topic.get_message_path("angular_velocity.x")
df = angular_velocity_x.get_data_as_df()
print(df.head())
# angular_velocity.x
# log_time
# 1722870127699468923                  0.1
# 1722870127699468924                  0.15
print(f"Mean: {df[angular_velocity_x.path].mean()}")
# Mean: 0.125

Properties

MessagePath.max

Maximum value observed for this message path.

Return type: PreComputedStat

MessagePath.mean

Mean (average) value for this message path.

Return type: PreComputedStat

MessagePath.median

Median value for this message path.

Return type: PreComputedStat

MessagePath.message_path_id

message_path_id str #

Unique identifier for this message path.

Return type: str

MessagePath.metadata

metadata dict[str, Any] #

Metadata dictionary associated with this message path.

Return type: dict[str, Any]

MessagePath.min

Minimum value observed for this message path.

Return type: PreComputedStat

MessagePath.modified

modified datetime.datetime #

Timestamp when this message path was last modified.

Return type: datetime.datetime

MessagePath.modified_by

modified_by str #

Identifier of the user or system that last modified this message path.

Return type: str

MessagePath.org_id

org_id str #

Organization ID that owns this message path.

Return type: str

MessagePath.p25

25th percentile of the values observed for this message path.

Return type: PreComputedStat

MessagePath.p75

75th percentile of the values observed for this message path.

Return type: PreComputedStat

MessagePath.p95

95th percentile of the values observed for this message path.

Return type: PreComputedStat

MessagePath.p99

99th percentile of the values observed for this message path.

Return type: PreComputedStat

MessagePath.parents()

static parents(path_in_schema)#View Source

Get parent paths for a message path.

Given a path_in_schema (list of path components), returns a list of its parent paths ordered from most specific to least specific.

Parameters

path_in_schema list[str]

List of path components (e.g., [“pose”, “pose”, “position”, “x”]).

Returns

list[str]

List of parent paths in dot notation, ordered from most to least specific.

Raises

TypeError

If a string is passed instead of a list. This method previously accepted a dot-delimited string; passing a string now would silently iterate over its characters and produce wrong results.

Usage

path_in_schema = ["pose", "pose", "position", "x"]
MessagePath.parents(path_in_schema)
# ['pose.pose.position', 'pose.pose', 'pose']
# Single level path has no parents
MessagePath.parents(["velocity"])
# []

Properties

MessagePath.path

path str #

Dot-delimited path to the attribute (e.g., ‘pose.position.x’).

Return type: str

MessagePath.record

Underlying MessagePathRecord for this message path.

MessagePath.stddev

Standard deviation of the values observed for this message path.

Return type: PreComputedStat

MessagePath.to_association()

to_association()#View Source

Convert this message path to an Association object.

Creates an Association object that can be used to reference this message path in other parts of the Roboto platform.

Returns

Association object representing this message path.

Usage

message_path = MessagePath.from_id("mp_abc123")
association = message_path.to_association()
print(association.association_type)
# AssociationType.MessagePath
print(association.association_id)
# mp_abc123

Properties

MessagePath.topic_id

topic_id str #

Unique identifier of the topic containing this message path.

Return type: str

MessagePathChangeset

class roboto.domain.topics.MessagePathChangeset(/, **data)#View Source

Bases: pydantic.BaseModel

Changeset for batch operations on topic message paths.

Defines a collection of add, delete, and update operations to be applied to a topic’s message paths in a single atomic operation. Useful for making multiple schema changes efficiently.

Parameters

data Any

MessagePathChangeset.check_replace_all_correctness()

check_replace_all_correctness()#View Source

MessagePathChangeset.from_replacement_message_paths()

classmethod from_replacement_message_paths(message_paths)#View Source

Create a changeset that replaces all existing message paths.

Creates a changeset that will replace all existing message paths on a topic with the provided set of message paths. This is useful for completely redefining a topic’s schema.

Parameters

message_paths collections.abc.Sequence[AddMessagePathRequest]

Sequence of message path requests to replace existing paths.

Returns

MessagePathChangeset configured to replace all existing message paths.

Usage

from roboto.domain.topics import AddMessagePathRequest, CanonicalDataType
new_paths = [
    AddMessagePathRequest(
        message_path="velocity.x", data_type="float32", canonical_data_type=CanonicalDataType.Number
    )
]
changeset = MessagePathChangeset.from_replacement_message_paths(new_paths)

MessagePathChangeset.has_changes()

has_changes()#View Source

Check whether the changeset contains any actual changes.

Returns

bool

True if the changeset contains operations that would modify the topic’s message paths.

Attributes

MessagePathChangeset.message_paths_to_add

message_paths_to_add collections.abc.Sequence[AddMessagePathRequest] | None = None #

Message paths to add to a topic.

MessagePathChangeset.message_paths_to_delete

message_paths_to_delete collections.abc.Sequence[DeleteMessagePathRequest] | None = None #

Message paths to delete from a topic.

MessagePathChangeset.message_paths_to_update

message_paths_to_update collections.abc.Sequence[UpdateMessagePathRequest] | None = None #

Message paths to update on a topic.

MessagePathChangeset.replace_all

replace_all bool = False #

Flag indicating whether this changeset should replace all message paths on a topic.

It assumes that the replacement message paths will be provided via message_paths_to_add. Rather than setting this flag directly, use appropriate class methods such as from_replacement_message_paths.

MessagePathMetadataWellKnown

class roboto.domain.topics.MessagePathMetadataWellKnown#View Source

Bases: roboto.compat.StrEnum

Well-known metadata key names (with well-known semantics) that may be set in metadata.

These are most often set by Roboto’s first-party ingestion actions and used by Roboto clients.

Attributes

MessagePathMetadataWellKnown.Categories

Categories = 'categories' #

An ordered list of values that a Categorical can take.

Usage

  • "categories"=["off", "on"]
  • "categories"=["left", "up", "right", "down"]

MessagePathMetadataWellKnown.ColumnName

ColumnName = 'column_name' #

The original name or path to this field in the source data schema. May differ from message_path if character substitutions were applied to conform to naming requirements.

Notes

MessagePathMetadataWellKnown.Unit

Unit = 'unit' #

Unit of a field. E.g., ‘ns’ for a timestamp. If provided, must match a known, supported unit from TimeUnit.

MessagePathRecord

class roboto.domain.topics.MessagePathRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Record representing a message path within a topic.

Defines a specific field or signal within a topic’s data schema, including its data type, metadata, and statistical information. Message paths use dot notation to specify nested attributes within complex message structures.

Message paths are the fundamental units for accessing individual data elements within time-series robotics data, enabling fine-grained analysis and visualization of specific signals or measurements.

Parameters

data Any

Attributes

MessagePathRecord.canonical_data_type

canonical_data_type CanonicalDataType #

Normalized data type, used primarily internally by the Roboto Platform.

MessagePathRecord.created

created datetime.datetime #

MessagePathRecord.created_by

created_by str #

MessagePathRecord.data_type

data_type str #

‘Native’/framework-specific data type of the attribute at this path. E.g. “float32”, “uint8[]”, “geometry_msgs/Pose”, “string”.

MessagePathRecord.message_path

message_path str #

Dot-delimited path to the attribute within the datum record.

MessagePathRecord.message_path_id

message_path_id str #

MessagePathRecord.metadata

metadata collections.abc.Mapping[str, Any] = None #

Key-value pairs to associate with this metadata for discovery and search, e.g. { ‘min’: ‘0.71’, ‘max’: ’1.77 }

MessagePathRecord.modified

modified datetime.datetime #

MessagePathRecord.modified_by

modified_by str #

MessagePathRecord.org_id

org_id str #

This message path’s organization ID, which is the organization ID of the containing topic.

MessagePathRecord.parents()

parents(delimiter='.')#View Source

Logical message path ancestors of this path.

Usage

Given a deeply nested field root.sub_obj_1.sub_obj_2.leaf_field:

field = "root.sub_obj_1.sub_obj_2.leaf_field"
record = MessagePathRecord(message_path=field)  # other fields omitted for brevity
print(record.parents())
# ['root.sub_obj_1.sub_obj_2', 'root.sub_obj_1', 'root']

Parameters

delimiter str

Return type

list[str]

Attributes

MessagePathRecord.path_in_schema

path_in_schema list[str] #

List of path components representing the field’s location in the original data schema. Unlike message_path, which must conform to Roboto-specific naming requirements and assumes dots separated path parts imply nested data, this preserves the exact path from the source data for accurate attribute access. This is expected to be the split representation of source_path.

MessagePathRecord.representations

representations collections.abc.MutableSequence[RepresentationRecord] = None #

Zero to many Representations of this MessagePath.

MessagePathRecord.source_path

source_path str #

The original name of this field in the source data schema. May differ from message_path if character substitutions were applied to conform to naming requirements.

This is the preferred field to use when specifying message_path_include or message_path_exclude to the get_data or get_data_as_df methods of Topic and Event.

MessagePathRecord.to_field_selection()

to_field_selection()#View Source

Translate this record into the FieldSelection the format decoders accept.

Attributes

MessagePathRecord.topic_id

topic_id str #

MessagePathRepresentationMapping

class roboto.domain.topics.MessagePathRepresentationMapping(/, **data)#View Source

Bases: pydantic.BaseModel

Mapping between message paths and their data representation.

Associates a set of message paths with a specific representation that contains their data. This mapping is used to efficiently locate and access data for specific message paths within topic representations.

Parameters

data Any

Attributes

MessagePathRepresentationMapping.message_paths

message_paths collections.abc.MutableSequence[MessagePathRecord] #

MessagePathRepresentationMapping.representation

representation RepresentationRecord #

MessagePathStatistic

class roboto.domain.topics.MessagePathStatistic(*args, **kwds)#View Source

Bases: enum.Enum

Statistics computed by Roboto in our standard ingestion actions.

Which of these a given message path actually carries depends on the ingestion path that produced it, so treat every one as optional: read them with metadata.get(...) or through the corresponding MessagePath property, both of which yield None when the statistic was never written, and never assume a missing value means zero. Indexing metadata directly raises KeyError for a statistic that was never written.

Attributes

MessagePathStatistic.Count

Count = 'count' #

MessagePathStatistic.Max

Max = 'max' #

MessagePathStatistic.Mean

Mean = 'mean' #

MessagePathStatistic.Median

Median = 'median' #

MessagePathStatistic.Min

Min = 'min' #

MessagePathStatistic.P25

P25 = 'p25' #

MessagePathStatistic.P75

P75 = 'p75' #

MessagePathStatistic.P95

P95 = 'p95' #

MessagePathStatistic.P99

P99 = 'p99' #

MessagePathStatistic.Stddev

Stddev = 'stddev' #

RepresentationRecord

class roboto.domain.topics.RepresentationRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Record representing a data representation for topic content.

A representation is a pointer to processed topic data stored in a specific format and location. Representations enable efficient access to topic data by providing multiple storage formats optimized for different use cases.

Most message paths within a topic point to the same representation (e.g., an MCAP or Parquet file containing all topic data). However, some message paths may have multiple representations for analytics or preview formats.

Representations are versioned and associated with specific files or storage locations through the association field.

Parameters

data Any

Attributes

RepresentationRecord.association

Identifier and entity type with which this Representation is associated. E.g., a file, a database.

RepresentationRecord.created

created datetime.datetime #

RepresentationRecord.format

format str | None = None #

Content format descriptor for this representation. For image topics: the image encoding (e.g. “jpeg”, “png”) for simplified representations, or the ROS schema name (e.g. “sensor_msgs/Image”) for original/passthrough representations. None for non-image topics or legacy representations.

RepresentationRecord.modified

modified datetime.datetime #

RepresentationRecord.representation_id

representation_id str #

RepresentationRecord.storage_format

RepresentationRecord.topic_id

topic_id str #

RepresentationRecord.transformations

transformations list[str] = None #

Ordered list of transformation descriptors applied to produce this representation. Empty for original/passthrough representations.

Each entry is a "<kind>:<param>" string where <kind> is a TransformationKind member. Construct entries via TransformationKind.with_param() and parse them via TransformationKind.parse() to keep the vocabulary centralized.

Example: ["downsample:0.5", "encode:jpeg"]

RepresentationRecord.version

version int #

RepresentationSelector

class roboto.domain.topics.RepresentationSelector(/, **data)#View Source

Bases: pydantic.BaseModel

Criteria for selecting among multiple representations of the same data.

When a message path has multiple representations (e.g., both raw sensor data and a processed JPEG encoding), this is a hard filter: only matching representations qualify, and message paths with no matching representation are dropped from selection results — callers must handle empty or partial output.

Legacy carve-out for ``content_format``: representations with no format set (i.e., predating the field) are treated as matching any content_format request. This keeps older data accessible. When both an explicit format match and a legacy representation are available for the same message path, the explicit match wins.

Instances are immutable (frozen=True) so they can be safely shared — including as default arguments to methods like Topic.get_data().

Parameters

data Any

Attributes

RepresentationSelector.content_format

content_format str | None = None #

If set, only representations whose format field matches this value qualify (e.g., "jpeg"). Representations with no format also qualify under the legacy carve-out. None means no constraint.

RepresentationSelector.matches()

matches(representation)#View Source

Check whether a representation satisfies this selector’s criteria.

A representation matches when each non-None selector field is satisfied. For content_format, representations with no format set are treated as matching (legacy carve-out — see class docstring).

Parameters

representation RepresentationRecord

Return type

bool

Attributes

RepresentationSelector.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

RepresentationSelector.raw()

classmethod raw()#View Source

Select representations with no transformations applied (original data).

RepresentationSelector.select_representations()

select_representations(mappings)#View Source

Select one representation per message path that matches this selector.

When the API returns multiple representations for the same message paths (e.g., both a raw MCAP and a processed JPEG MCAP for an image topic), this method picks a matching representation for each path and deduplicates so each message path appears in exactly one mapping.

Non-matching representations are excluded. When both an explicit format match and a legacy representation (no format set) cover the same message path, the explicit match wins. Message paths covered by no matching representation are dropped — callers must handle empty or partial results.

Parameters

All representation mappings, potentially with overlapping message paths.

Returns

Deduplicated mappings of message paths to matching representations. Empty if no representation matches.

Attributes

RepresentationSelector.transformations

transformations list[str] | None = None #

If set, only representations whose transformations field matches exactly qualify. [] matches representations with no transformations (i.e., raw/original data). None means no constraint.

RepresentationStorageFormat

class roboto.domain.topics.RepresentationStorageFormat(*args, **kwds)#View Source

Bases: enum.Enum

Supported storage formats for topic data representations.

Defines the available formats for storing and accessing topic data within the Roboto platform. Each format has different characteristics and use cases.

Attributes

RepresentationStorageFormat.MCAP

MCAP = 'mcap' #

MCAP format - optimized for robotics time-series data with efficient random access.

RepresentationStorageFormat.PARQUET

PARQUET = 'parquet' #

Parquet format - columnar storage optimized for analytics and large-scale data processing.

SchemaFieldRecord

class roboto.domain.topics.SchemaFieldRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A single field within a topic schema.

One entry per unique field path within a schema; field paths are deduplicated across topics that share the schema.

Parameters

data Any

Attributes

SchemaFieldRecord.canonical_data_type

canonical_data_type CanonicalDataType #

Normalized data type used for cross-framework compatibility and UI rendering decisions.

SchemaFieldRecord.created

created datetime.datetime | None = None #

SchemaFieldRecord.created_by

created_by str #

SchemaFieldRecord.data_type

data_type str #

Native, framework-specific data type of the field. E.g. “float32”, “uint8[]”, “geometry_msgs/Pose”.

SchemaFieldRecord.field_id

field_id str #

SchemaFieldRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

SchemaFieldRecord.modified

modified datetime.datetime | None = None #

SchemaFieldRecord.modified_by

modified_by str #

SchemaFieldRecord.name

name str #

Human-readable display name of the field (typically the final component of path_in_schema).

SchemaFieldRecord.org_id

org_id str #

SchemaFieldRecord.path_in_schema

path_in_schema FieldPath #

Path components locating this field in the source data schema. Each component is a schema-native attribute name, in order from the schema root to the leaf.

SchemaFieldRecord.schema_id

schema_id str #

SchemaFieldRecord.unit

unit str | None = None #

Optional unit of the field’s values (e.g., "ns", "m/s"). None if the field is unitless or unknown.

SetDefaultRepresentationRequest

class roboto.domain.topics.SetDefaultRepresentationRequest(/, **data)#View Source

Bases: BaseAddRepresentationRequest

Request to set the default representation for a topic.

Designates a specific representation as the default for accessing topic data. The default representation is used when no specific representation is requested for data access operations.

Parameters

data Any

Attributes

SetDefaultRepresentationRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

SetTimelineOffsetsRequest

class roboto.domain.topics.SetTimelineOffsetsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request body for POST /v1/files/id/<id>/timeline-offsets.

Atomic request: the server applies all entries together or fails.

Parameters

data Any

Attributes

SetTimelineOffsetsRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

SetTimelineOffsetsRequest.offsets

offsets list[TimelineOffsetEntry] = None #

Offsets to apply, at least one. An entry whose selectors reach no extent on this file is skipped as long as another entry reaches one; a request whose entries together reach none is refused. When two entries reach the same extent, the later entry’s offset applies.

TimelineExtentRecord

class roboto.domain.topics.TimelineExtentRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Min/max timestamp bounds for one topic partition measured against one timeline source.

Written by ingest when a partition’s timestamps are summarized for a given source (e.g., a schema timestamp field, or message log/publish time).

Stored timestamps come through verbatim from the data source: they may be absolute nanoseconds since the Unix epoch, or partition-relative (e.g., monotonic from zero). unix_epoch_offset_ns is the calibration that projects stored values onto Unix-epoch wall-clock: session_time_ns = stored_time_ns + unix_epoch_offset_ns. A value of 0 means the stored timestamps are already absolute Unix-epoch ns, or that no calibration has been applied yet.

Parameters

data Any

Attributes

TimelineExtentRecord.created

created datetime.datetime | None = None #

TimelineExtentRecord.created_by

created_by str #

TimelineExtentRecord.max_timestamp

max_timestamp int | None = None #

Largest stored timestamp in this extent, in nanoseconds. Absolute or partition-relative per the source.

TimelineExtentRecord.min_timestamp

min_timestamp int | None = None #

Smallest stored timestamp in this extent, in nanoseconds. Absolute or partition-relative per the source.

TimelineExtentRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TimelineExtentRecord.modified

modified datetime.datetime | None = None #

TimelineExtentRecord.modified_by

modified_by str #

TimelineExtentRecord.org_id

org_id str #

TimelineExtentRecord.timeline_extent_id

timeline_extent_id str #

TimelineExtentRecord.timeline_source_id

timeline_source_id str #

ID of the timeline source these bounds are measured against.

TimelineExtentRecord.topic_part_id

topic_part_id str #

ID of the topic partition these bounds apply to.

TimelineExtentRecord.unix_epoch_offset_ns

unix_epoch_offset_ns int = 0 #

Nanoseconds to add to each stored timestamp to obtain Unix-epoch wall-clock time: session_time_ns = stored_time_ns + unix_epoch_offset_ns. 0 when stored timestamps are already absolute Unix-epoch ns, or when no calibration has been recorded for this partition/source pair.

TimelineOffsetEntry

class roboto.domain.topics.TimelineOffsetEntry(/, **data)#View Source

Bases: pydantic.BaseModel

One offset for set_timeline_offsets().

Optional selectors narrow which of the file’s timelines the offset applies to.

Topic selector:

  • topic_name: the topic’s name (e.g. "/imu/raw"); topic names are unique within a single file. Scopes the offset to a single topic on the file.

Timeline-source selector (give at most one):

  • timeline_source_name: the source’s name (e.g. "header.stamp"). Source names are not unique, so the offset applies to every source with that name within the topic selector’s scope.
  • timeline_source_id: explicit id, for callers holding a TimelineSourceRecord.

Omitting every selector applies the offset to every timeline on the file.

Parameters

data Any

Attributes

TimelineOffsetEntry.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TimelineOffsetEntry.timeline_source_id

timeline_source_id str | None = None #

TimelineOffsetEntry.timeline_source_name

timeline_source_name str | None = None #

TimelineOffsetEntry.topic_name

topic_name str | None = None #

TimelineOffsetEntry.unix_epoch_offset_ns

unix_epoch_offset_ns roboto.time._EpochNanosecondsFromTime = None #

Nanoseconds added to the file’s stored timestamps so they read as Unix-epoch time (session_time_ns = stored_time_ns + unix_epoch_offset_ns). Must not be negative, and must fit in the signed 64-bit integer the platform stores it in. Also accepts any roboto.time.Time at runtime, read as roboto.time.to_epoch_nanoseconds() reads it, so an instant such as a datetime becomes the nanoseconds since the Unix epoch at which stored time 0 occurred; convert with that function first to satisfy a type checker.

TimelineSourceKind

type roboto.domain.topics.TimelineSourceKind = typing.Literal['schema_field', 'message_log_time', 'message_publish_time']#View Source

Discriminator for how a TimelineSourceRecord derives its timestamps.

"schema_field" points at a timestamp field inside the schema (field_id is set). "message_log_time" and "message_publish_time" point at the message envelope’s log or publish timestamp respectively (field_id is None).

TimelineSourceRecord

class roboto.domain.topics.TimelineSourceRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A registered timeline source for a schema.

A timeline source either points at a timestamp field inside the schema (source="schema_field", field_id set) or at the message envelope’s log or publish timestamp (source in {"message_log_time", "message_publish_time"}, field_id is None). Timeline sources are scoped to a schema, not a topic, so topics that share a schema share their timeline sources.

Parameters

data Any

Attributes

TimelineSourceRecord.created

created datetime.datetime | None = None #

TimelineSourceRecord.created_by

created_by str #

TimelineSourceRecord.field_id

field_id str | None = None #

ID of the schema field supplying timestamps. Set when source == "schema_field"; otherwise None.

TimelineSourceRecord.is_default

is_default bool = False #

Whether this timeline source is the default for its schema when no source is specified explicitly.

TimelineSourceRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TimelineSourceRecord.modified

modified datetime.datetime | None = None #

TimelineSourceRecord.modified_by

modified_by str #

TimelineSourceRecord.name

name str #

Human-readable label for this timeline source.

TimelineSourceRecord.org_id

org_id str #

TimelineSourceRecord.schema_id

schema_id str #

ID of the schema this timeline source is registered against.

TimelineSourceRecord.source

Where timestamps come from: a schema field ("schema_field"), or the message envelope’s log or publish timestamp ("message_log_time" / "message_publish_time").

TimelineSourceRecord.timeline_source_id

timeline_source_id str #

TimelineSourceUpdate

class roboto.domain.topics.TimelineSourceUpdate(/, **data)#View Source

Bases: pydantic.BaseModel

Partial update for a timeline source.

Fields left at NotSet are not modified.

Parameters

data Any

Attributes

TimelineSourceUpdate.is_default

is_default bool | roboto.sentinels.NotSetType #

TimelineSourceUpdate.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TimelineSourceUpdate.name

Timestamp

type roboto.domain.topics.Timestamp = typing.Union[int, float]#View Source

Topic

class roboto.domain.topics.Topic(record, roboto_client=None, topic_data_service=None)#View Source

Represents a topic within the Roboto platform.

A topic is a sequence of structured time-series data linked to a source file, typically containing sensor readings, robot state information, or other timestamped data streams. Topics are fundamental building blocks for data analysis in robotics, providing organized access to time-synchronized data from various sources like ROS bags, MCAP files, or other structured data formats.

Each topic follows a defined schema where message paths represent the individual fields or signals within that schema. Topics enable efficient querying, filtering, and analysis of time-series data, supporting operations like temporal slicing, field selection, and data export to various formats including pandas DataFrames.

Topics are associated with files and inherit access permissions from their parent dataset. They provide the primary interface for accessing ingested robotics data in the Roboto platform, supporting both programmatic access through the SDK and visualization in the web interface.

The Topic class serves as the main interface for topic operations in the Roboto SDK, providing methods for data retrieval, message path management, metadata operations, and schema management.

Topic.add_message_path()

add_message_path(message_path, data_type, canonical_data_type, path_in_schema=None, metadata=None)#View Source

Add a new message path to this topic.

Creates a new message path within this topic, defining a specific field or signal that can be extracted from the topic’s data. Message paths use dot notation to specify nested attributes within the topic’s schema.

Parameters

message_path str

Dot-delimited path to the attribute (e.g., “pose.position.x”).

data_type str

Native data type of the attribute as it appears in the original data source (e.g., “float32”, “uint8[]”, “geometry_msgs/Pose”). Used primarily for display purposes and should match the robot’s runtime language or schema definitions.

Normalized Roboto data type that enables specialized platform features for maps, images, timestamps, and other data with special interpretations.

path_in_schema Optional[list[str]]

List of path components representing the field’s location in the source data schema. Unlike message_path, which assumes dots separate path parts implying nested data, this preserves the exact path from the source data for accurate attribute access.

metadata Optional[dict[str, Any]]

Additional metadata to associate with the message path.

Returns

MessagePathRecord representing the newly created message path.

Raises

Message path already exists for this topic.

Caller lacks permission to modify the topic.

Usage

from roboto.domain.topics import CanonicalDataType
topic = Topic.from_id("topic_xyz789")
message_path = topic.add_message_path(
    message_path="pose.position.x",
    data_type="float64",
    canonical_data_type=CanonicalDataType.Number,
    metadata={"unit": "meters"},
)
print(message_path.message_path)
# pose.position.x

Topic.add_message_path_representation()

add_message_path_representation(message_path_id, association, storage_format, version, format=None, transformations=None)#View Source

Add a representation for a specific message path.

Associates a message path with a data representation, enabling efficient access to specific fields within the topic data. Representations can be in different storage formats like MCAP or Parquet.

Parameters

message_path_id str

Unique identifier of the message path.

Association pointing to the representation data.

Format of the representation data.

version int

Version number of the representation.

format Optional[str]

Content format descriptor (e.g. “jpeg”, “sensor_msgs/Image”).

transformations Optional[list[str]]

Transformation descriptors applied (e.g. [“downsample:0.5”]).

Returns

RepresentationRecord representing the newly created representation.

Raises

Message path with the given ID does not exist.

Caller lacks permission to modify the topic.

Usage

from roboto.association import Association
from roboto.domain.topics import RepresentationStorageFormat
topic = Topic.from_id("topic_xyz789")
representation = topic.add_message_path_representation(
    message_path_id="mp_123",
    association=Association.file("file_repr_456"),
    storage_format=RepresentationStorageFormat.MCAP,
    version=1,
)
print(representation.representation_id)
# repr_789

Properties

Topic.association

Association linking this topic to its source entity (typically a file).

Topic.create()

classmethod create(file_id, topic_name, end_time=None, message_count=None, metadata=None, schema_checksum=None, schema_name=None, start_time=None, message_paths=None, caller_org_id=None, roboto_client=None)#View Source

Create a new topic associated with a file.

Creates a new topic record in the Roboto platform, associating it with the specified file and defining its schema and temporal boundaries. This method is typically used during data ingestion to register topics found in robotics data files.

Parameters

file_id str

Unique identifier of the file this topic is associated with.

topic_name str

Name of the topic (e.g., “/camera/image”, “/imu/data”).

end_time Optional[int]

End time of the topic data in nanoseconds since UNIX epoch.

message_count Optional[int]

Total number of messages in this topic.

metadata Optional[collections.abc.Mapping[str, Any]]

Additional metadata to associate with the topic.

schema_checksum Optional[str]

Checksum of the topic’s message schema for validation.

schema_name Optional[str]

Name of the message schema (e.g., “sensor_msgs/Image”).

start_time Optional[int]

Start time of the topic data in nanoseconds since UNIX epoch.

message_paths Optional[collections.abc.Sequence[roboto.domain.topics.operations.AddMessagePathRequest]]

Message paths to create along with the topic.

caller_org_id Optional[str]

Organization ID to create the topic in. Required for multi-org users.

roboto_client Optional[roboto.http.RobotoClient]

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

Returns

Topic instance representing the newly created topic.

Raises

Invalid topic parameters.

Caller lacks permission to create topics.

Usage

Create a basic topic for camera data:

topic = Topic.create(
    file_id="file_abc123",
    topic_name="/camera/image",
    schema_name="sensor_msgs/Image",
    start_time=1722870127699468923,
    end_time=1722870127799468923,
    message_count=100,
)
print(topic.topic_id)
# topic_xyz789

Create a topic with metadata and message paths:

from roboto.domain.topics import AddMessagePathRequest, CanonicalDataType
message_paths = [
    AddMessagePathRequest(
        message_path="header.stamp.sec",
        data_type="uint32",
        canonical_data_type=CanonicalDataType.Timestamp,
    )
]
topic = Topic.create(
    file_id="file_abc123",
    topic_name="/imu/data",
    schema_name="sensor_msgs/Imu",
    metadata={"sensor_type": "IMU", "frequency": 100},
    message_paths=message_paths,
)

Topic.create_from_df()

classmethod create_from_df(file_id, dataset_id, topic_name, df, timestamp_column=None, timestamp_unit=None, caller_org_id=None, roboto_client=None)#View Source

Create a Topic from a pandas DataFrame and associate it with a file.

If a topic with the same name already exists for the specified file, it will be updated with the new data and schema.

Parameters

file_id str

ID of the file to associate this topic with.

dataset_id str

ID of the dataset containing the file.

topic_name str

Name for the topic. Must be unique within the file.

df pandas.DataFrame

pandas DataFrame containing the data to ingest. Must include a timestamp column (either explicitly specified or automatically detectable).

timestamp_column Optional[str]

Name of the column to use as the timestamp. If not provided, the method will attempt to automatically detect a timestamp column by looking for the first column that is a timezone-aware timestamp type.

timestamp_unit Optional[Union[str, roboto.time.TimeUnit]]

Unit of the timestamp column values. Required when timestamp_column contains numeric values (int, float, decimal). Valid values include “s”, “ms”, “us”, “ns”. Not needed for datetime columns or when timestamp_column is not specified.

caller_org_id Optional[str]

Organization ID of the caller. If not provided, uses the default from the client context.

roboto_client Optional[roboto.http.RobotoClient]

Roboto client instance. If not provided, uses the default client.

Returns

The created or updated Topic instance.

Raises

If the timestamp column cannot be determined, is not present in the DataFrame, has an invalid type, or if the timestamp unit is required but not provided.

ImportError

If pandas or pyarrow are not installed. Install with pip install roboto[ingestion] to use this feature.

If the caller lacks permission to create topics or upload files to the specified dataset.

Notes

Usage

Create a topic when you have file and dataset IDs:

import pandas as pd
from roboto.domain.topics import Topic
df = pd.DataFrame(
    {
        "timestamp": [1763947309.4198897, 1763947316.7686195, 1763947335.0095527],
        "temperature": [20.5, 21.0, 20.8],
        "humidity": [45.2, 46.1, 45.8],
    }
)
topic = Topic.create_from_df(
    file_id="file_abc123",
    dataset_id="ds_xyz789",
    topic_name="sensor_data",
    df=df,
    timestamp_column="timestamp",
    timestamp_unit="s",
)
print(f"Created topic: {topic.name}")
# Created topic: sensor_data

Using File.add_topic() is typically more convenient:

from roboto import File
file = File.from_id("file_abc123")
topic = file.add_topic("sensor_data", df, timestamp_column="timestamp", timestamp_unit="s")

Properties

Topic.created

created datetime.datetime #

Timestamp when this topic was created in the Roboto platform.

Return type: datetime.datetime

Topic.created_by

created_by str #

Identifier of the user or system that created this topic.

Return type: str

Topic.dataset_id

dataset_id str | None #

Unique identifier of the dataset containing this topic, if applicable.

Return type: Optional[str]

Topic.default_representation

Default representation used for accessing this topic’s data.

Topic.delete()

delete()#View Source

Delete this topic from the Roboto platform.

Permanently removes this topic and all its associated message paths and representations from the platform. This operation cannot be undone.

Raises

Topic does not exist or has already been deleted.

Caller lacks permission to delete the topic.

Return type

None

Usage

topic = Topic.from_id("topic_xyz789")
topic.delete()
# # Topic and all its data are now permanently deleted

Properties

Topic.end_time

end_time int | None #

End time of the topic data in nanoseconds since UNIX epoch.

Return type: Optional[int]

Topic.file_id

file_id str | None #

Unique identifier of the file containing this topic, if applicable.

Return type: Optional[str]

Topic.from_id()

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

Retrieve a topic by its unique identifier.

Fetches a topic record from the Roboto platform using its unique topic ID. This is the most direct way to access a specific topic when you know its identifier.

Parameters

topic_id str

Unique identifier for the topic.

roboto_client Optional[roboto.http.RobotoClient]

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

Returns

Topic instance representing the requested topic.

Raises

Topic with the given ID does not exist.

Caller lacks permission to access the topic.

Usage

topic = Topic.from_id("topic_xyz789")
print(topic.name)
# '/camera/image'
print(topic.message_count)
# 100

Topic.from_name_and_file()

classmethod from_name_and_file(topic_name, file_id, owner_org_id=None, roboto_client=None)#View Source

Retrieve a topic by its name and associated file.

Fetches a topic record using its name and the file it’s associated with. This is useful when you know the topic name (e.g., “/camera/image”) and the file containing the topic data.

Parameters

topic_name str

Name of the topic to retrieve.

file_id str

Unique identifier of the file containing the topic.

owner_org_id Optional[str]

Organization ID to scope the search. If None, uses caller’s org.

roboto_client Optional[roboto.http.RobotoClient]

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

Returns

Topic instance representing the requested topic.

Raises

Topic with the given name does not exist in the specified file.

Caller lacks permission to access the topic.

Usage

topic = Topic.from_name_and_file(topic_name="/camera/image", file_id="file_abc123")
print(topic.topic_id)
# topic_xyz789
print(len(topic.message_paths))
# 5

Topic.get_by_dataset()

classmethod get_by_dataset(dataset_id, roboto_client=None)#View Source

List all topics associated with files in a dataset.

Retrieves all topics from files within the specified dataset. If multiple files contain topics with the same name (e.g., chunked files with the same schema), they are returned as separate topic objects.

Parameters

dataset_id str

Unique identifier of the dataset to search.

roboto_client Optional[roboto.http.RobotoClient]

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

Yields

Topic instances associated with files in the dataset.

Raises

Dataset with the given ID does not exist.

Caller lacks permission to access the dataset.

Return type

collections.abc.Generator[Topic, None, None]

Usage

for topic in Topic.get_by_dataset("ds_abc123"):
    print(f"Topic: {topic.name} (File: {topic.file_id})")
# Topic: /camera/image (File: file_001)
# Topic: /imu/data (File: file_001)
# Topic: /camera/image (File: file_002)
# Topic: /imu/data (File: file_002)
# Count topics by name
from collections import Counter
topic_names = [topic.name for topic in Topic.get_by_dataset("ds_abc123")]
print(Counter(topic_names))
# Counter({'/camera/image': 2, '/imu/data': 2})

Topic.get_by_file()

classmethod get_by_file(file_id, owner_org_id=None, roboto_client=None)#View Source

List all topics associated with a specific file.

Retrieves all topics contained within the specified file. This is useful for exploring the structure of robotics data files and understanding what data streams are available.

Parameters

file_id str

Unique identifier of the file to search.

owner_org_id Optional[str]

Organization ID to scope the search. If None, uses caller’s org.

roboto_client Optional[roboto.http.RobotoClient]

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

Yields

Topic instances associated with the specified file.

Raises

File with the given ID does not exist.

Caller lacks permission to access the file.

Return type

collections.abc.Generator[Topic, None, None]

Usage

for topic in Topic.get_by_file("file_abc123"):
    print(f"Topic: {topic.name} ({topic.message_count} messages)")
# Topic: /camera/image (150 messages)
# Topic: /imu/data (1500 messages)
# Topic: /gps/fix (50 messages)
# Get topics with specific schema
camera_topics = [topic for topic in Topic.get_by_file("file_abc123") if "camera" in topic.name]

Topic.get_data()

get_data(message_paths_include=None, message_paths_exclude=None, start_time=None, end_time=None, cache_dir=None, representation_selector=RepresentationSelector.raw())#View Source

Return this topic’s underlying data.

Retrieves and yields data records from this topic, with optional filtering by message paths and time range. Each yielded datum is a dictionary that matches this topic’s schema.

Parameters

message_paths_include Optional[collections.abc.Iterable[str]]

Dot notation paths that match attributes of individual data records to include. If None, all paths are included.

message_paths_exclude Optional[collections.abc.Iterable[str]]

Dot notation paths that match attributes of individual data records to exclude. If None, no paths are excluded.

start_time Optional[roboto.time.Time]

Start time (inclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

end_time Optional[roboto.time.Time]

End time (exclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

cache_dir Union[str, pathlib.Path, None]

Directory where topic data will be downloaded if necessary. Defaults to DEFAULT_CACHE_DIR.

Criteria for selecting among multiple representations. Defaults to RepresentationSelector.raw() — original, untransformed data. Pass a RepresentationSelector to request a specific content format or transformation pipeline.

Yields

Timestamp and dictionary records that match this topic’s schema, filtered according to the parameters.

Return type

collections.abc.Generator[tuple[roboto.domain.topics.topic_reader.Timestamp, dict[str, Any]], None, None]

Notes

For each example below, assume the following is a sample datum record that can be found in this topic:

{

“angular_velocity”: {

“x”: <uint32>, “y”: <uint32>, “z”: <uint32>

}, “orientation”: { “x”: <uint32>, “y”: <uint32>, “z”: <uint32>, “w”: <uint32> }

}

Usage

Print all data to stdout:

topic = Topic.from_name_and_file(...)
for timestamp, record in topic.get_data():
    print(timestamp, record)

Only include the “angular_velocity” sub-object, but filter out its “y” property:

topic = Topic.from_name_and_file(...)
for timestamp, record in topic.get_data(
    message_paths_include=["angular_velocity"],
    message_paths_exclude=["angular_velocity.y"],
):
    ...

Only include data between two timestamps:

topic = Topic.from_name_and_file(...)
for timestamp, record in topic.get_data(
    start_time=1722870127699468923,
    end_time=1722870127699468924,
):
    ...

Collect all topic data into a dataframe (requires installing the roboto[analytics] extra):

topic = Topic.from_name_and_file(...)
df = topic.get_data_as_df()

Get the JPEG-encoded version of image data:

topic = Topic.from_name_and_file(...)
for timestamp, record in topic.get_data(
    representation_selector=RepresentationSelector(content_format="jpeg"),
):
    ...

Topic.get_data_as_df()

get_data_as_df(message_paths_include=None, message_paths_exclude=None, start_time=None, end_time=None, cache_dir=None, representation_selector=RepresentationSelector.raw())#View Source

Return this topic’s underlying data as a pandas DataFrame.

Retrieves topic data and converts it to a pandas DataFrame for analysis and visualization. The DataFrame is indexed by log time and contains columns for each message path in the topic data.

Parameters

message_paths_include Optional[collections.abc.Iterable[str]]

Dot notation paths that match attributes of individual data records to include. If None, all paths are included.

message_paths_exclude Optional[collections.abc.Iterable[str]]

Dot notation paths that match attributes of individual data records to exclude. If None, no paths are excluded.

start_time Optional[roboto.time.Time]

Start time (inclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

end_time Optional[roboto.time.Time]

End time (exclusive) as nanoseconds since UNIX epoch or convertible to such by to_epoch_nanoseconds().

cache_dir Union[str, pathlib.Path, None]

Directory where topic data will be downloaded if necessary. Defaults to DEFAULT_CACHE_DIR.

Criteria for selecting among multiple representations. Defaults to RepresentationSelector.raw() — original, untransformed data. Pass a RepresentationSelector to request a specific content format or transformation pipeline.

Returns

pandas.DataFrame

pandas DataFrame containing the topic data, indexed by log time.

Raises

ImportError

pandas is not installed. Install with roboto[analytics] extra.

Notes

Requires installing this package using the roboto[analytics] extra.

An array-typed message path (for example a float32[3] acceleration) becomes a single column whose values are lists. Individual array elements are not addressable on their own — neither as separate DataFrame columns nor as message paths in message_paths_include / message_paths_exclude. Filter by the array’s path and unpack the column with numpy, as in the example below. np.stack requires every row to have the same length; a variable-length array path (for example a point cloud) must instead be processed row-wise, e.g. with df[col].map(...).

Usage

topic = Topic.from_name_and_file("/imu/data", "file_abc123")
df = topic.get_data_as_df()
print(df.head())
# angular_velocity.x  angular_velocity.y  ...
# log_time
# 1722870127699468923                  0.1                 0.2  ...
# 1722870127699468924                  0.15                0.25 ...
# Filter specific message paths
df_filtered = topic.get_data_as_df(
    message_paths_include=["angular_velocity"], message_paths_exclude=["angular_velocity.z"]
)
print(df_filtered.columns.tolist())
# ['angular_velocity.x', 'angular_velocity.y']
# Unpack a fixed-length array-typed path (a list-valued column) into a numpy array
import numpy as np
df_accel = topic.get_data_as_df(message_paths_include=["acceleration"])
xyz = np.stack(df_accel["acceleration"].to_numpy())  # shape (N, 3)

Topic.get_message_path()

get_message_path(message_path)#View Source

Get a specific message path from this topic.

Retrieves a MessagePath object for the specified path, enabling access to individual fields or signals within the topic’s data schema.

Parameters

message_path str

Dot-delimited path to the desired attribute (e.g., “pose.position.x”).

Returns

MessagePath instance for the specified path.

Raises

ValueError

No message path with the given name exists in this topic.

Usage

topic = Topic.from_name_and_file("/imu/data", "file_abc123")
angular_vel_x = topic.get_message_path("angular_velocity.x")
print(angular_vel_x.canonical_data_type)
# CanonicalDataType.Number
# Access message path statistics
print(angular_vel_x.mean)
# 0.125
print(angular_vel_x.std_dev)
# 0.05

Topic.get_schema()

get_schema()#View Source

Retrieve the schema for this topic, if one exists.

Returns

A TopicSchema describing the message structure of this topic, or None if this topic has no schema.

Raises

schema_id references a schema that no longer exists.

Usage

topic = Topic.from_id("topic_xyz789")
schema = topic.get_schema()
if schema is not None:
    for field in schema.fields:
        print(field.name, field.data_type)

Topic.get_time_bounds_by_association()

classmethod get_time_bounds_by_association(association, owner_org_id=None, roboto_client=None)#View Source

Get the earliest start and latest end across every topic of a file or dataset.

The same aggregate you would reach by folding start_time and end_time over the topics of that file or dataset, computed server-side in one request instead of one per page of topics.

Parameters

The file or dataset whose topics are aggregated, e.g. Association.file("file_abc123").

owner_org_id Optional[str]

Organization ID to scope the lookup. If None, uses caller’s org.

roboto_client Optional[roboto.http.RobotoClient]

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

Returns

Bounds in nanoseconds since the Unix epoch. Both fields are None when the association holds no topics, and either is None when no topic of the association carries that timestamp.

Raises

Caller lacks permission to access the file or dataset.

Usage

from roboto.association import Association
bounds = Topic.get_time_bounds_by_association(Association.file("file_abc123"))
print(bounds.start_time, bounds.end_time)
# 1722870127699468923 1722870187004821001

Properties

Topic.message_count

message_count int | None #

Total number of messages in this topic.

Return type: Optional[int]

Topic.message_paths

message_paths collections.abc.Sequence[roboto.domain.topics.record.MessagePathRecord] #

Sequence of message path records defining the topic’s schema.

Return type: collections.abc.Sequence[roboto.domain.topics.record.MessagePathRecord]

Topic.metadata

metadata dict[str, Any] #

Metadata dictionary associated with this topic.

Return type: dict[str, Any]

Topic.modified

modified datetime.datetime #

Timestamp when this topic was last modified.

Return type: datetime.datetime

Topic.modified_by

modified_by str #

Identifier of the user or system that last modified this topic.

Return type: str

Topic.name

name str #

Name of the topic (e.g., ‘/camera/image’, ‘/imu/data’).

Return type: str

Topic.org_id

org_id str #

Organization ID that owns this topic.

Return type: str

Topic.record

Topic representation in the Roboto database.

This property is on the path to deprecation. All TopicRecord attributes are accessible directly using a Topic instance.

Topic.refresh()

refresh()#View Source

Refresh this topic instance with the latest data from the platform.

Fetches the current state of the topic from the Roboto platform and updates this instance’s data. Useful when the topic may have been modified by other processes or users.

Usage

topic = Topic.from_id("topic_xyz789")
# Topic may have been updated by another process
topic.refresh()
print(f"Current message count: {topic.message_count}")

Return type

None

Properties

Topic.schema_checksum

schema_checksum str | None #

Checksum of the topic’s message schema for validation.

Return type: Optional[str]

Topic.schema_id

schema_id str | None #

ID of the schema for this topic.

None if the topic has no schema, or if the schema has not yet been populated.

Return type: Optional[str]

Topic.schema_name

schema_name str | None #

Name of the message schema (e.g., ‘sensor_msgs/Image’).

Return type: Optional[str]

Topic.set_default_representation()

set_default_representation(association, storage_format, version, format=None, transformations=None)#View Source

Set the default representation for this topic.

Designates a specific representation as the default for this topic, which will be used when accessing topic data without specifying a particular representation.

Parameters

Association pointing to the representation data.

Format of the representation data.

version int

Version number of the representation.

format Optional[str]

Content format descriptor (e.g. “jpeg”, “sensor_msgs/Image”).

transformations Optional[list[str]]

Transformation descriptors applied (e.g. [“downsample:0.5”]).

Returns

RepresentationRecord representing the newly set default representation.

Raises

Specified representation does not exist.

Caller lacks permission to modify the topic.

Usage

from roboto.association import Association
from roboto.domain.topics import RepresentationStorageFormat
topic = Topic.from_id("topic_xyz789")
default_repr = topic.set_default_representation(
    association=Association.file("file_repr_456"),
    storage_format=RepresentationStorageFormat.MCAP,
    version=2,
)
print(topic.default_representation.representation_id)
# repr_789

Properties

Topic.start_time

start_time int | None #

Start time of the topic data in nanoseconds since UNIX epoch.

Return type: Optional[int]

Topic.to_association()

to_association()#View Source

Convert this topic to an Association object.

Creates an Association object that can be used to reference this topic in other parts of the Roboto platform.

Returns

Association object representing this topic.

Usage

topic = Topic.from_id("topic_xyz789")
association = topic.to_association()
print(association.association_type)
# AssociationType.Topic
print(association.association_id)
# topic_xyz789

Properties

Topic.topic_id

topic_id str #

Unique identifier for this topic.

Return type: str

Topic.topic_name

topic_name str #

Name of the topic (e.g., ‘/camera/image’, ‘/imu/data’).

Return type: str

Topic.update()

update(end_time=NotSet, message_count=NotSet, schema_checksum=NotSet, schema_name=NotSet, start_time=NotSet, metadata_changeset=NotSet, message_path_changeset=NotSet)#View Source

Updates a topic’s attributes and (optionally) its message paths.

Parameters

schema_name Union[Optional[str], roboto.sentinels.NotSetType]

topic schema name. Setting to None clears the attribute.

schema_checksum Union[Optional[str], roboto.sentinels.NotSetType]

topic schema checksum. Setting to None clears the attribute.

start_time Union[Optional[int], roboto.sentinels.NotSetType]

topic data start time, in epoch nanoseconds. Must be non-negative. Setting to None clears the attribute.

end_time Union[Optional[int], roboto.sentinels.NotSetType]

topic data end time, in epoch nanoseconds. Must be non-negative, and greater than start_time. Setting to None clears the attribute.

message_count Union[int, roboto.sentinels.NotSetType]

number of messages recorded for this topic. Must be non-negative.

a set of changes to apply to the topic’s metadata

a set of additions, deletions or updates to this topic’s message paths. Updating or deleting non-existent message paths has no effect. Attempting to (re-)add existing message paths raises RobotoConflictException, unless the changeset’s replace_all flag is set to True

Returns

this Topic object with any updates applied

Raises

if any method argument has an invalid value, e.g. a negative message_count

if, as part of the update, an attempt is made to add an already extant message path, and to this topic, and replace_all is not toggled on the message_path_changeset

Topic.update_message_path()

update_message_path(message_path, metadata_changeset=NotSet, data_type=NotSet, canonical_data_type=NotSet, path_in_schema=NotSet)#View Source

Update the metadata and attributes of a message path.

Modifies an existing message path within this topic, allowing updates to its metadata, data type, and canonical data type. This is useful for correcting or enhancing message path definitions after initial creation.

Parameters

message_path str

Name of the message path to update (e.g., “pose.position.x”).

Metadata changeset to apply to any existing metadata.

data_type Union[str, roboto.sentinels.NotSetType]

Native (application-specific) message path data type.

Canonical Roboto data type corresponding to the native data type.

path_in_schema Union[list[str], roboto.sentinels.NotSetType]

Returns

MessagePath instance representing the updated message path.

Raises

No message path with the given name exists for this topic.

Caller lacks permission to modify the topic.

Usage

from roboto.updates import TaglessMetadataChangeset
from roboto.domain.topics import CanonicalDataType
topic = Topic.from_id("topic_xyz789")

# Update metadata for a message path
changeset = TaglessMetadataChangeset(put_fields={"unit": "meters"})
updated_path = topic.update_message_path(message_path="pose.position.x", metadata_changeset=changeset)
print(updated_path.metadata["unit"])
# meters
# Update data type and canonical type
updated_path = topic.update_message_path(
    message_path="velocity", data_type="float64", canonical_data_type=CanonicalDataType.Number
)

TopicDataService

class roboto.domain.topics.TopicDataService(roboto_client, cache_dir=None)#View Source

Internal service for retrieving topic data.

This service handles the low-level operations for accessing topic data that has been ingested by the Roboto platform. It manages downloads, filtering, and processing various data formats to provide efficient access to time-series robotics data.

Parameters

cache_dir Union[str, pathlib.Path, None]

Attributes

TopicDataService.DEFAULT_CACHE_DIR

DEFAULT_CACHE_DIR ClassVar[pathlib.Path] #

TopicDataService.get_data()

get_data(topic_id, message_paths_include=None, message_paths_exclude=None, start_time=None, end_time=None, cache_dir_override=None, representation_selector=RepresentationSelector.raw())#View Source

Retrieve data for a specific topic with optional filtering.

Parameters

topic_id str

Unique identifier of the topic to retrieve data for.

message_paths_include Optional[collections.abc.Iterable[str]]

Dot notation paths to include in the results. If None, all paths are included.

message_paths_exclude Optional[collections.abc.Iterable[str]]

Dot notation paths to exclude from the results. If None, no paths are excluded.

start_time Optional[roboto.time.Time]

Start time (inclusive) for temporal filtering.

end_time Optional[roboto.time.Time]

End time (exclusive) for temporal filtering.

cache_dir_override Union[str, pathlib.Path, None]

Override the default cache directory for downloads.

Criteria for selecting among multiple representations. Defaults to RepresentationSelector.raw().

Yields

Tuple of (timestamp, record) where timestamp is in nanoseconds since Unix epoch.

Return type

collections.abc.Generator[tuple[roboto.domain.topics.topic_reader.Timestamp, dict[str, Any]], None, None]

TopicDataService.get_data_as_df()

get_data_as_df(topic_id, message_paths_include=None, message_paths_exclude=None, start_time=None, end_time=None, cache_dir_override=None, representation_selector=RepresentationSelector.raw())#View Source

Retrieve data for a specific topic as a pandas DataFrame with optional filtering.

Parameters

topic_id str

Unique identifier of the topic to retrieve data for.

message_paths_include Optional[collections.abc.Iterable[str]]

Dot notation paths to include in the results. If None, all paths are included.

message_paths_exclude Optional[collections.abc.Iterable[str]]

Dot notation paths to exclude from the results. If None, no paths are excluded.

start_time Optional[roboto.time.Time]

Start time (inclusive) for temporal filtering.

end_time Optional[roboto.time.Time]

End time (exclusive) for temporal filtering.

cache_dir_override Union[str, pathlib.Path, None]

Override the default cache directory for downloads.

Criteria for selecting among multiple representations. Defaults to RepresentationSelector.raw().

Returns

pandas.DataFrame

pandas.DataFrame The index of the DataFrame (df.index) is a pandas.DateTimeIndex, labeling the timestamp of each row.

TopicIdentityRecord

class roboto.domain.topics.TopicIdentityRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A durable identity for a topic.

Within an organization, topic names are unique: data logged under the same topic name in different files shares a single identity record.

Parameters

data Any

Attributes

TopicIdentityRecord.created

created datetime.datetime | None = None #

TopicIdentityRecord.created_by

created_by str #

TopicIdentityRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TopicIdentityRecord.modified

modified datetime.datetime | None = None #

TopicIdentityRecord.modified_by

modified_by str #

TopicIdentityRecord.name

name str #

Human-readable topic name (e.g., "/camera/image_raw"). Unique within an organization.

TopicIdentityRecord.org_id

org_id str #

TopicIdentityRecord.topic_id

topic_id str #

Stable identifier for this topic identity.

TopicPartitionRecord

class roboto.domain.topics.TopicPartitionRecord(/, **data)#View Source

Bases: pydantic.BaseModel

One file’s data for a topic.

Pairs a topic identity with a file and carries the facts that vary from file to file: the schema the file’s messages follow (schema_id), the device that produced them, and the data_range locating them inside the file, for formats that pack several slices of data into one shared file. A partition references a file, not a specific version; reads always resolve to the current version.

Parameters

data Any

Attributes

TopicPartitionRecord.created

created datetime.datetime | None = None #

TopicPartitionRecord.created_by

created_by str #

TopicPartitionRecord.data_range

data_range DataRange | None = None #

The slice of the file this partition’s data occupies, as (start, end), or None for the whole file.

start alone identifies the partition within its (topic, file) pair, since a slice’s starting position is stable across re-ingest: re-declaring a slice that begins at the same position updates the existing partition instead of adding a second, overlapping one.

TopicPartitionRecord.device_id

device_id str | None = None #

ID of the device that produced this partition’s data, if known.

TopicPartitionRecord.fs_node_id

fs_node_id str #

ID of the file this partition’s data lives in.

TopicPartitionRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TopicPartitionRecord.modified

modified datetime.datetime | None = None #

TopicPartitionRecord.modified_by

modified_by str #

TopicPartitionRecord.org_id

org_id str #

TopicPartitionRecord.schema_id

schema_id str #

ID of the schema this partition’s messages follow.

TopicPartitionRecord.topic_id

topic_id str #

ID of the topic identity this partition belongs to.

TopicPartitionRecord.topic_part_id

topic_part_id str #

TopicRecord

class roboto.domain.topics.TopicRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Record representing a topic in the Roboto platform.

A topic is a collection of timestamped data records that share a common name and association (typically a file). Topics represent logical data streams from robotics systems, such as sensor readings, robot state information, or other time-series data.

Data from the same file with the same topic name are considered part of the same topic. Data from different files or with different topic names belong to separate topics, even if they have similar schemas.

When source files are chunked by time or size but represent the same logical data collection, they will produce multiple topic records for the same “logical topic” (same name and schema) across those chunks.

Parameters

data Any

Attributes

TopicRecord.association

Identifier and entity type with which this Topic is associated. E.g., a file, a dataset.

TopicRecord.created

created datetime.datetime #

TopicRecord.created_by

created_by str #

TopicRecord.default_representation

default_representation RepresentationRecord | None = None #

Default Representation for this Topic. Assume that if a MessagePath is not more specifically associated with a Representation, it should use this one.

TopicRecord.end_time

end_time int | None = None #

Timestamp of oldest message in topic, in nanoseconds since epoch (assumed Unix epoch).

TopicRecord.message_count

message_count int | None = None #

TopicRecord.message_paths

message_paths collections.abc.MutableSequence[MessagePathRecord] = None #

Zero to many MessagePathRecords associated with this TopicSource.

TopicRecord.metadata

metadata collections.abc.Mapping[str, Any] = None #

Arbitrary metadata.

TopicRecord.modified

modified datetime.datetime #

TopicRecord.modified_by

modified_by str #

TopicRecord.org_id

org_id str #

TopicRecord.schema_checksum

schema_checksum str | None = None #

Checksum of topic schema. May be None if topic does not have a known/named schema.

TopicRecord.schema_id

schema_id str | None = None #

ID of the schema record for this topic. May be None if the topic has no schema, or if the schema record has not yet been populated.

TopicRecord.schema_name

schema_name str | None = None #

Type of messages in topic. E.g., “sensor_msgs/PointCloud2”. May be None if topic does not have a known/named schema.

TopicRecord.start_time

start_time int | None = None #

Timestamp of earliest message in topic, in nanoseconds since epoch (assumed Unix epoch).

TopicRecord.topic_id

topic_id str #

TopicRecord.topic_name

topic_name str #

TopicSchema

class roboto.domain.topics.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

TopicSchemaRecord

class roboto.domain.topics.TopicSchemaRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A content-addressed topic schema.

Within an organization, two schemas with identical fields share a single record (identified by a deterministic checksum of the fields). name is a mutable, informational label (last-writer-wins) and is not part of the schema’s identity.

Parameters

data Any

Attributes

TopicSchemaRecord.checksum

checksum str #

Deterministic checksum computed over the schema’s fields; identical schemas share a checksum.

TopicSchemaRecord.created

created datetime.datetime | None = None #

TopicSchemaRecord.created_by

created_by str #

TopicSchemaRecord.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

TopicSchemaRecord.modified

modified datetime.datetime | None = None #

TopicSchemaRecord.modified_by

modified_by str #

TopicSchemaRecord.name

name str | None = None #

Informational label for the schema (e.g., "sensor_msgs/PointCloud2"). Not part of identity.

TopicSchemaRecord.org_id

org_id str #

TopicSchemaRecord.schema_id

schema_id str #

Stable identifier for this schema record.

TopicTimeBounds

class roboto.domain.topics.TopicTimeBounds(/, **data)#View Source

Bases: pydantic.BaseModel

Earliest start and latest end, in epoch nanoseconds, across a set of topics.

The aggregate of the start_time and end_time of every topic in the set, computed server-side so a caller does not have to page the whole set to fold them.

Either field is None when no topic in the set carries that timestamp — because the set is empty, or because every topic in it left that bound unset.

Parameters

data Any

Attributes

TopicTimeBounds.end_time

end_time int | None = None #

Latest end_time across the set, in nanoseconds since epoch (assumed Unix epoch).

TopicTimeBounds.start_time

start_time int | None = None #

Earliest start_time across the set, in nanoseconds since epoch (assumed Unix epoch).

TransformationKind

class roboto.domain.topics.TransformationKind#View Source

Bases: roboto.compat.StrEnum

Canonical vocabulary of transformations that can be applied when producing a representation.

A transformation is serialized into RepresentationRecord.transformations as a "<kind>:<param>" string (e.g. "downsample:0.5", "encode:jpeg"). This enum is the source of truth for the set of supported kinds; the parameter tail remains free-form because different kinds carry different parameter shapes (floats, format tokens, etc.).

Producers should construct transformation strings via with_param() and consumers should destructure them via parse() to keep the vocabulary centralized.

Usage

TransformationKind.DOWNSAMPLE.with_param(0.5)
# 'downsample:0.5'
TransformationKind.parse("encode:jpeg")
# (<TransformationKind.ENCODE: 'encode'>, 'jpeg')

Attributes

TransformationKind.DOWNSAMPLE

DOWNSAMPLE = 'downsample' #

Spatial or temporal downsampling. Parameter is a float scale factor in (0, 1].

TransformationKind.ENCODE

ENCODE = 'encode' #

Re-encoding to a different content format. Parameter is the target format token (e.g. "jpeg").

TransformationKind.parse()

classmethod parse(descriptor)#View Source

Parse a "<kind>:<param>" transformation descriptor into its kind and raw parameter.

Parameters

descriptor str

Raises

ValueError

If the kind prefix is not a known TransformationKind member.

Return type

tuple[TransformationKind, str]

TransformationKind.with_param()

with_param(param)#View Source

Construct a transformation descriptor string for this kind with the given parameter.

Parameters

param object

Return type

str

UpdateMessagePathRequest

class roboto.domain.topics.UpdateMessagePathRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request to update an existing message path within a topic.

Allows modification of message path attributes including metadata, data type, and canonical data type. Used to correct or enhance message path definitions after initial creation.

Parameters

data Any

Attributes

UpdateMessagePathRequest.canonical_data_type

Canonical Roboto data type for the data under this message path (optional).

Note: updating this attribute should be done with care, as it affects Roboto’s ability to interpret and visualize the data.

UpdateMessagePathRequest.data_type

Native data type for the data under this message path (optional).

UpdateMessagePathRequest.has_updates()

has_updates()#View Source

Check whether this request would result in any message path modifications.

Returns

bool

True if the request contains changes that would modify the message path.

Attributes

UpdateMessagePathRequest.message_path

message_path str #

Message path name (required).

UpdateMessagePathRequest.metadata_changeset

A set of changes to the message path’s metadata (optional).

UpdateMessagePathRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

UpdateMessagePathRequest.path_in_schema

path_in_schema list[str] | roboto.sentinels.NotSetType #

List of path components representing the field’s location in the source data schema (optional).

For nested fields like ‘position.x’, this would be [‘position’, ‘x’].

UpdateTopicRequest

class roboto.domain.topics.UpdateTopicRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request to update an existing topic’s properties.

Allows modification of topic attributes including temporal boundaries, message count, schema information, metadata, and message paths.

Parameters

data Any

Attributes

UpdateTopicRequest.end_time

end_time int | None | roboto.sentinels.NotSetType #

UpdateTopicRequest.message_count

message_count int | roboto.sentinels.NotSetType #

UpdateTopicRequest.message_path_changeset

UpdateTopicRequest.metadata_changeset

UpdateTopicRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

UpdateTopicRequest.schema_checksum

schema_checksum str | None | roboto.sentinels.NotSetType #

UpdateTopicRequest.schema_name

schema_name str | None | roboto.sentinels.NotSetType #

UpdateTopicRequest.start_time

start_time int | None | roboto.sentinels.NotSetType #

Was this page helpful?