---
sidebar:
  hidden: true
title: roboto.domain.topics.record
---
## Module Contents

### CanonicalDataType

```python
class roboto.domain.topics.record.CanonicalDataType(*args, **kwds)
```

`from roboto import CanonicalDataType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L217-L299)

Bases: `enum.Enum`

Framework-independent data type of a message path, which Roboto uses to choose how to display its data.

Each native field type, such as a field type of ROS 1 ([http://wiki.ros.org/msg](http://wiki.ros.org/msg)), ROS 2 ([https://docs.ros.org/en/iron/Concepts/Basic/About-Interfaces.html#field-types](https://docs.ros.org/en/iron/Concepts/Basic/About-Interfaces.html#field-types)) or uORB ([https://docs.px4.io/main/en/middleware/uorb.html#adding-a-new-topic](https://docs.px4.io/main/en/middleware/uorb.html#adding-a-new-topic)), maps onto one of these. For example:

- `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'`: Sequence of values.

- **CanonicalDataType.Boolean** = `'boolean'`: True or false value.

- **CanonicalDataType.Byte** = `'byte'`: Single byte.

- **CanonicalDataType.Categorical** = `'categorical'`: Value from a fixed, ordered set of values, such as `"off"` or `"on"`.

  The message path's metadata must have a `"categories"` key (`MessagePathMetadataWellKnown.Categories`) listing the values in order, such as `["off", "on"]`. Roboto maps each value to its index in that list, `"off"` to 0 and `"on"` to 1, so it can plot changes from one value to another. Outside a plot, Roboto displays categorical data as it displays `String` data.

- **CanonicalDataType.Image** = `'image'`: Data that Roboto can display as an image.

- **CanonicalDataType.LatDegFloat** = `'latdegfloat'`: Latitude in degrees, as a float, such as `47.6749387`.

  ULog files with `ver_data_format` 2 or later use it.

- **CanonicalDataType.LatDegInt** = `'latdegint'`: Latitude in degrees times 10\^7, as an integer, such as `317534036` for 31.7534036 degrees.

  ULog files with `ver_data_format` below 2 use it.

- **CanonicalDataType.LonDegFloat** = `'londegfloat'`: Longitude in degrees, as a float, such as `9.1445274`.

  ULog files with `ver_data_format` 2 or later use it.

- **CanonicalDataType.LonDegInt** = `'londegint'`: Longitude in degrees times 10\^7, as an integer, such as `1199146398` for 119.9146398 degrees.

  ULog files with `ver_data_format` below 2 use it.

- **CanonicalDataType.Number** = `'number'`: Numeric scalar, such as an integer or a float.

- **CanonicalDataType.NumberArray** = `'number_array'`: Flat sequence of numeric scalars, of fixed or variable length.

  Elements are ints, floats, or decimals: never booleans, strings, nested sequences, or structs, so a `NumberArray` message path never has child message paths. A fixed length appears as the trailing `[<N>]` of `data_type` (`float64[7]`, `fixed_size_list<element: double>[3]`) and is read by [`array_length`](/docs/reference/python-sdk/roboto/domain/topics/message_path#roboto.domain.topics.message_path.MessagePath.array_length); `float64[]` and `list<element: double>` declare none.

  Code that creates message paths (ingestion actions, [`create_from_df()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.create_from_df)) must not assign this type to arrays of byte-width element types (`uint8`, `int8`, `byte`, `char`), because those typically hold raw bytes (images, serialized blobs), not signals to plot. ULog ingestion is the exception: it types `int8_t[N]` and `uint8_t[N]` as `NumberArray`. Code that must exclude byte payloads therefore checks `data_type` for a byte-width element type rather than relying on this type alone.

- **CanonicalDataType.Object** = `'object'`: Struct with attributes.

- **CanonicalDataType.String** = `'string'`: Text.

- **CanonicalDataType.Timestamp** = `'timestamp'`: Instant in time, as the time elapsed since the Unix epoch.

  The unit is the message path's `"unit"` metadata value, which must be a [`TimeUnit`](/docs/reference/python-sdk/roboto/time#roboto.time.TimeUnit) value: `"s"`, `"ms"`, `"us"` or `"ns"`. Without that key, Roboto reads the value as nanoseconds.

- **CanonicalDataType.Unknown** = `'unknown'`: Data that fits no other type. Assign it only when no other type applies.

### DataRange

```python
roboto.domain.topics.record.DataRange
```

`from roboto.domain.topics.record import DataRange`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L635-L635)

A slice of one file's contents, as `(start, end)` with `start` included and `end` excluded.

A position is expressed in whatever the file's format uses to address its contents: stored-row positions counted from 0, or nanoseconds of media time for video. The pair alone does not say which of the two applies, so a reader takes that from the file's format. The half-open form matches LeRobot's `dataset_from_index` and `dataset_to_index`, so row ranges read from LeRobot episode metadata carry over unchanged.

### FieldPath

```python
roboto.domain.topics.record.FieldPath
```

`from roboto.domain.topics.record import FieldPath`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L601-L601)

Path components of a schema field, in order from the schema root to the leaf.

### FixedArrayDataType

```python
class roboto.domain.topics.record.FixedArrayDataType
```

`from roboto.domain.topics.record import FixedArrayDataType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L308-L359)

Element type and length that a flat, fixed-length array declares in its `data_type`.

Build one with `parse`.

**Attributes**

- **FixedArrayDataType.element_type** (`str`): Type of each element, as the recording format spells it.

  `float32` for `float32[6]`, and `float` for the Arrow `fixed_size_list<element: float not null>[6]`.

- **FixedArrayDataType.length** (`int`): Number of elements, from the trailing `[<N>]`.

**Properties**

- **FixedArrayDataType.has_byte_width_elements** (`bool`): Whether each element is one byte wide.

  The one-byte element types are `uint8`, `int8`, `uint8_t`, `int8_t`, `byte`, `char` and `octet`, in any letter case. Arrays of them typically hold raw bytes, not signals; see `CanonicalDataType.NumberArray`.

#### FixedArrayDataType.parse()

```python
@classmethod
def parse(data_type: str) -> Optional[FixedArrayDataType]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L324-L349)

Build the element type and length from a `data_type` that ends in a single `[<N>]`.

`float64[7]`, `Point[3]` and `fixed_size_list<element: double>[3]` parse.

**Parameters**

- **data_type** (`str`): Native data type of a field or message path.

**Returns**

- `Optional[FixedArrayDataType]`: The element type and length, or `None` for a variable-length array (`float64[]`, `list<element: double>`), a ROS 2 bounded one (`float64[<=10]`), a multi-dimensional one (`float64[2][3]`, `fixed_size_list<element: list<element: double>>[3]`) or a scalar.

### MessagePathMetadataWellKnown

```python
class roboto.domain.topics.record.MessagePathMetadataWellKnown
```

`from roboto import MessagePathMetadataWellKnown`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L383-L407)

Bases: `roboto.compat.StrEnum`

Metadata key that Roboto gives a meaning to in `MessagePathRecord.metadata`.

Roboto's ingestion actions usually set these keys, and Roboto's clients read them.

**Attributes**

- **MessagePathMetadataWellKnown.Categories** = `'categories'`: Ordered list of the values a `CanonicalDataType.Categorical` message path takes.

  For example, `["off", "on"]` or `["left", "up", "right", "down"]`.

- **MessagePathMetadataWellKnown.ColumnName** = `'column_name'`: Deprecated. Field's name or path in the source data's schema.

  Use `MessagePathRecord.source_path` instead. The name or path can differ from `MessagePathRecord.message_path` when characters were replaced to meet message path naming rules. `MessagePathRecord.path_in_schema` holds the same path as a list of components, and [`AddMessagePathRequest`](/docs/reference/python-sdk/roboto/domain/topics/operations#roboto.domain.topics.operations.AddMessagePathRequest) sets it.

- **MessagePathMetadataWellKnown.Unit** = `'unit'`: Unit of the message path's values, such as `"ns"` for a timestamp.

  When set, it must be a [`TimeUnit`](/docs/reference/python-sdk/roboto/time#roboto.time.TimeUnit) value.

### MessagePathRecord

```python
class roboto.domain.topics.record.MessagePathRecord(/, **data: Any)
```

`from roboto import MessagePathRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L410-L496)

Bases: `pydantic.BaseModel`

Data record of a message path, as the Roboto API returns it.

A message path is one field or signal of a topic's messages, such as `"pose.position.x"`. [`MessagePath`](/docs/reference/python-sdk/roboto/domain/topics/message_path#roboto.domain.topics.message_path.MessagePath) wraps this record with methods that act on the message path, and exposes it as [`record`](/docs/reference/python-sdk/roboto/domain/topics/message_path#roboto.domain.topics.message_path.MessagePath.record).

**Parameters**

- **data** (`Any`)

**Attributes**

- **MessagePathRecord.canonical_data_type** (`CanonicalDataType`): Framework-independent data type of the field, which Roboto uses to choose how to display its data.

- **MessagePathRecord.created** (`datetime.datetime`): Time the message path was created.

- **MessagePathRecord.created_by** (`str`): ID of the user who created the message path.

- **MessagePathRecord.data_type** (`str`): Native data type of the field, as the source data's framework names it.

  For example, `"float32"`, `"uint8[]"`, `"geometry_msgs/Pose"` or `"string"`.

- **MessagePathRecord.message_path** (`str`): Dot-delimited path to the field within the topic's messages, such as `"pose.position.x"`.

- **MessagePathRecord.message_path_id** (`str`): Unique ID of the message path, beginning with `mp_`.

- **MessagePathRecord.metadata** (`collections.abc.Mapping[str, Any]`) = `None`: Key-value metadata on the message path, such as `{"min": 0.71, "max": 1.77}`.

  `MessagePathStatistic` and `MessagePathMetadataWellKnown` list the keys Roboto gives a meaning to.

- **MessagePathRecord.modified** (`datetime.datetime`): Time the message path was last modified.

- **MessagePathRecord.modified_by** (`str`): ID of the user who last modified the message path.

- **MessagePathRecord.org_id** (`str`): ID of the organization that owns the message path, which is the organization that owns its topic.

- **MessagePathRecord.path_in_schema** (`list[str]`): Components of the field's path in the source data's schema, in order from the schema root.

  Each component keeps the source's own name. `message_path` instead follows Roboto's naming rules and treats every dot as a separator between nested fields, so this is the path to use to find the field in the source data.

- **MessagePathRecord.representations** (`collections.abc.MutableSequence[RepresentationRecord]`) = `None`: Representations that hold this message path's data, if any.

- **MessagePathRecord.source_path** (`str`): Name of the field in the source data's schema: `path_in_schema` joined with dots.

  It can differ from `message_path` when characters were replaced to meet message path naming rules. Prefer it when you pass `message_paths_include` or `message_paths_exclude` to the `get_data` and `get_data_as_df` methods of [`Topic`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic) and [`Event`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event).

- **MessagePathRecord.topic_id** (`str`): ID of the topic this message path belongs to.

#### MessagePathRecord.parents()

```python
def parents(delimiter: str = '.') -> list[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L477-L492)

Return the paths of this field's ancestors in the source data's schema, nearest first.

Each ancestor's path is leading components of `path_in_schema`, joined with `delimiter`.

**Parameters**

- **delimiter** (`str`): String to join path components with.

**Returns**

- `list[str]`

**Usage**

For a record whose `path_in_schema` is `["root", "sub_obj_1", "sub_obj_2", "leaf_field"]`:

```python
record.parents()
# ['root.sub_obj_1.sub_obj_2', 'root.sub_obj_1', 'root']
```

#### MessagePathRecord.to_field_selection()

```python
def to_field_selection() -> roboto.formats.FieldSelection
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L494-L496)

Return this field as the [`FieldSelection`](/docs/reference/python-sdk/roboto/formats/fields#roboto.formats.fields.FieldSelection) that format readers take.

**Returns**

- `roboto.formats.FieldSelection`

### MessagePathRepresentationMapping

```python
class roboto.domain.topics.record.MessagePathRepresentationMapping(/, **data: Any)
```

`from roboto.domain.topics import MessagePathRepresentationMapping`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L499-L511)

Bases: `pydantic.BaseModel`

Item of the response body of `GET /v1/topics/id/{topic_id}/message-path/representations`.

It pairs message paths with a representation that holds their data. [`get_data()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_data) and [`get_data_as_df()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_data_as_df) read the list to choose where each message path's data comes from.

**Parameters**

- **data** (`Any`)

**Attributes**

- **MessagePathRepresentationMapping.message_paths** (`collections.abc.MutableSequence[MessagePathRecord]`): Message paths whose data the representation holds.
- **MessagePathRepresentationMapping.representation** (`RepresentationRecord`): Record of the representation that holds the message paths' data.

### MessagePathStatistic

```python
class roboto.domain.topics.record.MessagePathStatistic(*args, **kwds)
```

`from roboto import MessagePathStatistic`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L362-L380)

Bases: `enum.Enum`

Statistic that Roboto's ingestion actions compute for a message path, keyed by this value in its metadata.

Which statistics a message path has depends on the action that ingested it, so treat each one as optional. Read it with `metadata.get(...)` or the matching [`MessagePath`](/docs/reference/python-sdk/roboto/domain/topics/message_path#roboto.domain.topics.message_path.MessagePath) property, which both return `None` for a statistic that was never computed; a missing statistic does not mean zero. Indexing `MessagePathRecord.metadata` directly raises `KeyError` for a missing one.

**Attributes**

- **MessagePathStatistic.Count** = `'count'`
- **MessagePathStatistic.Max** = `'max'`
- **MessagePathStatistic.Mean** = `'mean'`
- **MessagePathStatistic.Median** = `'median'`
- **MessagePathStatistic.Min** = `'min'`
- **MessagePathStatistic.P25** = `'p25'`
- **MessagePathStatistic.P75** = `'p75'`
- **MessagePathStatistic.P95** = `'p95'`
- **MessagePathStatistic.P99** = `'p99'`
- **MessagePathStatistic.Stddev** = `'stddev'`

### RepresentationRecord

```python
class roboto.domain.topics.record.RepresentationRecord(/, **data: Any)
```

`from roboto import RepresentationRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L172-L214)

Bases: `pydantic.BaseModel`

Data record of a representation, as the Roboto API returns it.

A representation is one stored copy of a topic's data, in one file format and possibly transformed, such as downsampled or encoded as JPEG. Most of a topic's message paths share one representation, usually the MCAP or Parquet file that holds all of the topic's data; some message paths have further representations, such as a preview format.

**Parameters**

- **data** (`Any`)

**Attributes**

- **RepresentationRecord.association** (`roboto.association.Association`): Resource that holds the representation's data, usually a file.

- **RepresentationRecord.created** (`datetime.datetime`): Time the representation was created.

- **RepresentationRecord.format** (`str | None`) = `None`: Content format of the representation's data, or `None` when none was recorded, as for most non-image topics.

  For an image topic, this is the image encoding of an encoded representation, such as `"jpeg"` or `"png"`, or the message schema name of the original data, such as `"sensor_msgs/Image"`.

- **RepresentationRecord.modified** (`datetime.datetime`): Time the representation was last modified.

- **RepresentationRecord.representation_id** (`str`): Unique ID of the representation.

- **RepresentationRecord.storage_format** (`RepresentationStorageFormat`): File format the representation's data is stored in.

- **RepresentationRecord.topic_id** (`str`): ID of the topic this representation belongs to.

- **RepresentationRecord.transformations** (`list[str]`) = `None`: Transformations applied, in order, to produce this representation, or an empty list for the original data.

  Each entry is a `"<kind>:<param>"` string whose kind is a `TransformationKind` value, such as `["downsample:0.5", "encode:jpeg"]`.

- **RepresentationRecord.version** (`int`): Version number of the representation, as set when it was added.

### RepresentationSelector

```python
class roboto.domain.topics.record.RepresentationSelector(/, **data: Any)
```

`from roboto.domain.topics import RepresentationSelector`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L25-L113)

Bases: `pydantic.BaseModel`

Criteria for choosing which of a message path's representations to read.

A message path can have several representations, such as the original image messages and a JPEG encoding of them. A read uses only the representations that meet every criterion set on the selector, and leaves out a message path with no such representation, so it can return some of the requested message paths or none of them.

Instances are immutable, so one instance can serve as a default argument, as it does in [`get_data()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_data).

**Parameters**

- **data** (`Any`)

**Attributes**

- **RepresentationSelector.content_format** (`str | None`) = `None`: Content format that a representation's `format` must equal, such as `"jpeg"`, or `None` for no requirement.

  A representation whose `format` is `None` meets any value.

- **RepresentationSelector.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **RepresentationSelector.transformations** (`list[str] | None`) = `None`: Transformations that a representation's `transformations` must equal, in order, or `None` for no requirement.

  `[]` requires a representation with no transformations: the original data.

#### RepresentationSelector.matches()

```python
def matches(representation: RepresentationRecord) -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L55-L62)

Return whether `representation` meets every criterion set on this selector.

**Parameters**

- **representation** (`RepresentationRecord`)

**Returns**

- `bool`

#### RepresentationSelector.raw()

```python
@classmethod
def raw() -> RepresentationSelector
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L51-L53)

Build a selector that requires the original data: a representation with no transformations.

**Returns**

- `RepresentationSelector`

#### RepresentationSelector.select_representations()

```python
def select_representations(
    mappings: list[MessagePathRepresentationMapping],
) -> list[MessagePathRepresentationMapping]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L64-L113)

Choose one matching representation for each message path in `mappings`.

[`get_data()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_data) and [`get_data_as_df()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_data_as_df) choose representations through it, so most code never calls it.

A topic can have several representations covering the same message paths, such as an MCAP file of the original data and an MCAP file of JPEG-encoded images for an image topic. Mappings whose representation does not match are dropped, and each message path goes to the first remaining mapping that covers it. When `content_format` is set, representations whose `format` equals it come before those whose `format` is `None`; otherwise the order of `mappings` decides. A message path that no matching representation covers is left out.

**Parameters**

- **mappings** (`list[MessagePathRepresentationMapping]`): Message paths paired with the representations that hold their data. A message path can appear in more than one mapping.

**Returns**

- `list[MessagePathRepresentationMapping]`: Mappings in which each message path appears at most once, or an empty list when no representation matches.

### RepresentationStorageFormat

```python
class roboto.domain.topics.record.RepresentationStorageFormat(*args, **kwds)
```

`from roboto import RepresentationStorageFormat`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L116-L122)

Bases: `enum.Enum`

File format that a representation's data is stored in.

**Attributes**

- **RepresentationStorageFormat.MCAP** = `'mcap'`: MCAP, a container format for timestamped robotics messages.
- **RepresentationStorageFormat.PARQUET** = `'parquet'`: Apache Parquet, a columnar file format.

### SchemaFieldRecord

```python
class roboto.domain.topics.record.SchemaFieldRecord(/, **data: Any)
```

`from roboto import SchemaFieldRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L647-L684)

Bases: `pydantic.BaseModel`

Field of a topic schema.

A schema has one record per field path, and topics that share the schema share its field records.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SchemaFieldRecord.canonical_data_type** (`CanonicalDataType`): Framework-independent data type of the field, which Roboto uses to choose how to display its data.

- **SchemaFieldRecord.created** (`datetime.datetime | None`) = `None`

- **SchemaFieldRecord.created_by** (`str`)

- **SchemaFieldRecord.data_type** (`str`): Native data type of the field, as the source data's framework names it, such as `"float32"`.

- **SchemaFieldRecord.element_names** (`tuple[str, ...] | None`) = `None`: Name of each element of a fixed-length numeric array field, in element order, or `None` if not named.

  They are declared with `roboto.experimental.ingest.Field.element_names`.

- **SchemaFieldRecord.field_id** (`str`)

- **SchemaFieldRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **SchemaFieldRecord.modified** (`datetime.datetime | None`) = `None`

- **SchemaFieldRecord.modified_by** (`str`)

- **SchemaFieldRecord.name** (`str`): Display name of the field, usually the last component of `path_in_schema`.

- **SchemaFieldRecord.org_id** (`str`)

- **SchemaFieldRecord.path_in_schema** (`FieldPath`): Components of the field's path in the source data's schema, from the schema root to the leaf.

  Each component is the source's own name for that level of the schema.

- **SchemaFieldRecord.schema_id** (`str`)

- **SchemaFieldRecord.unit** (`str | None`) = `None`: Unit of the field's values, such as `"ns"` or `"m/s"`, or `None` if it has none or it is unknown.

### TimelineExtentRecord

```python
class roboto.domain.topics.record.TimelineExtentRecord(/, **data: Any)
```

`from roboto import TimelineExtentRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L790-L826)

Bases: `pydantic.BaseModel`

Smallest and largest timestamps of one topic partition, as one timeline source measures them.

Ingestion records them when it summarizes a partition's timestamps for a timeline source, such as a timestamp field of the schema or the messages' log time.

Timestamps are stored as the source data has them, so they can be nanoseconds since the Unix epoch or relative to the partition, such as a clock that starts at zero. `unix_epoch_offset_ns` converts a stored timestamp to nanoseconds since the Unix epoch: `unix_time_ns = stored_time_ns + unix_epoch_offset_ns`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TimelineExtentRecord.created** (`datetime.datetime | None`) = `None`

- **TimelineExtentRecord.created_by** (`str`)

- **TimelineExtentRecord.max_timestamp** (`int | None`) = `None`: Largest stored timestamp of the partition, in nanoseconds.

- **TimelineExtentRecord.min_timestamp** (`int | None`) = `None`: Smallest stored timestamp of the partition, in nanoseconds.

- **TimelineExtentRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **TimelineExtentRecord.modified** (`datetime.datetime | None`) = `None`

- **TimelineExtentRecord.modified_by** (`str`)

- **TimelineExtentRecord.org_id** (`str`)

- **TimelineExtentRecord.timeline_extent_id** (`str`)

- **TimelineExtentRecord.timeline_source_id** (`str`): ID of the timeline source that measures these timestamps.

- **TimelineExtentRecord.topic_part_id** (`str`): ID of the topic partition these timestamps belong to.

- **TimelineExtentRecord.unix_epoch_offset_ns** (`int`) = `0`: Nanoseconds to add to each stored timestamp to get nanoseconds since the Unix epoch.

  `0` when the stored timestamps already count from the Unix epoch, or when no offset has been recorded for this partition and timeline source.

### TimelineSourceKind

```python
type roboto.domain.topics.record.TimelineSourceKind = typing.Literal['schema_field', 'message_log_time', 'message_publish_time']
```

`from roboto import TimelineSourceKind`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L734-L734)

Where a `TimelineSourceRecord` takes its timestamps from.

- `"schema_field"`: a timestamp field of the schema, named by the record's `field_id`.
- `"message_log_time"`: the time each message was logged, from the message envelope.
- `"message_publish_time"`: the time each message was published, from the message envelope.

### TimelineSourceRecord

```python
class roboto.domain.topics.record.TimelineSourceRecord(/, **data: Any)
```

`from roboto import TimelineSourceRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L744-L786)

Bases: `pydantic.BaseModel`

Source of timestamps registered for a schema.

A timeline source takes timestamps from a timestamp field of the schema or from each message's log or publish time, as `source` says. Timeline sources belong to a schema, not a topic, so topics that share a schema share its timeline sources.

Building one raises `pydantic.ValidationError` when `source` is not a `TimelineSourceKind` value, when `source` is `"schema_field"` and `field_id` is `None`, or when `field_id` is set and `source` is anything else.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TimelineSourceRecord.created** (`datetime.datetime | None`) = `None`
- **TimelineSourceRecord.created_by** (`str`)
- **TimelineSourceRecord.field_id** (`str | None`) = `None`: ID of the schema field the timestamps come from when `source` is `"schema_field"`; otherwise `None`.
- **TimelineSourceRecord.is_default** (`bool`) = `False`: Whether this is its schema's default timeline source, used when no timeline source is named.
- **TimelineSourceRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- **TimelineSourceRecord.modified** (`datetime.datetime | None`) = `None`
- **TimelineSourceRecord.modified_by** (`str`)
- **TimelineSourceRecord.name** (`str`): Human-readable name of the timeline source.
- **TimelineSourceRecord.org_id** (`str`)
- **TimelineSourceRecord.schema_id** (`str`): ID of the schema this timeline source belongs to.
- **TimelineSourceRecord.source** (`TimelineSourceKind`): Where the timestamps come from: a schema field, or each message's log or publish time.
- **TimelineSourceRecord.timeline_source_id** (`str`)

### TopicIdentityRecord

```python
class roboto.domain.topics.record.TopicIdentityRecord(/, **data: Any)
```

`from roboto import TopicIdentityRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L714-L731)

Bases: `pydantic.BaseModel`

Identity of a topic across files.

Within an organization, data logged under the same topic name in different files shares one identity record.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TopicIdentityRecord.created** (`datetime.datetime | None`) = `None`
- **TopicIdentityRecord.created_by** (`str`)
- **TopicIdentityRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- **TopicIdentityRecord.modified** (`datetime.datetime | None`) = `None`
- **TopicIdentityRecord.modified_by** (`str`)
- **TopicIdentityRecord.name** (`str`): Name of the topic, such as `"/camera/image_raw"`, unique within an organization.
- **TopicIdentityRecord.org_id** (`str`)
- **TopicIdentityRecord.topic_id** (`str`): Unique ID of the topic identity.

### TopicPartitionRecord

```python
class roboto.domain.topics.record.TopicPartitionRecord(/, **data: Any)
```

`from roboto import TopicPartitionRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L830-L868)

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.

Building one raises `pydantic.ValidationError` for a `data_range` that `validate_data_range` rejects.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TopicPartitionRecord.created** (`datetime.datetime | None`) = `None`

- **TopicPartitionRecord.created_by** (`str`)

- **TopicPartitionRecord.data_range** (`DataRange | None`) = `None`: Slice of the file that 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** (`str | None`) = `None`: ID of the device that produced this partition's data, or `None` if unknown.

- **TopicPartitionRecord.fs_node_id** (`str`): ID of the file this partition's data is in.

- **TopicPartitionRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **TopicPartitionRecord.modified** (`datetime.datetime | None`) = `None`

- **TopicPartitionRecord.modified_by** (`str`)

- **TopicPartitionRecord.org_id** (`str`)

- **TopicPartitionRecord.schema_id** (`str`): ID of the schema this partition's messages follow.

- **TopicPartitionRecord.topic_id** (`str`): ID of the topic identity this partition belongs to.

- **TopicPartitionRecord.topic_part_id** (`str`)

### TopicRecord

```python
class roboto.domain.topics.record.TopicRecord(/, **data: Any)
```

`from roboto import TopicRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L514-L577)

Bases: `pydantic.BaseModel`

Data record of a topic, as the Roboto API returns it.

A topic is a sequence of structured time-series data, called messages, linked to a source file; each message follows the topic's schema. Data under one topic name in one file forms one topic. Data in different files, or under different names, forms separate topics even when the schemas match, so a recording split into several files by time or size yields one topic record per file for the same topic name. [`Topic`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic) wraps this record with methods that act on the topic, and exposes it as [`record`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.record).

**Parameters**

- **data** (`Any`)

**Attributes**

- **TopicRecord.association** (`roboto.association.Association`): Resource the topic belongs to, usually the file its data came from.

- **TopicRecord.created** (`datetime.datetime`): Time the topic was created.

- **TopicRecord.created_by** (`str`): ID of the user who created the topic.

- **TopicRecord.default_representation** (`RepresentationRecord | None`) = `None`: Record of the representation that holds the data of each message path without one of its own.

  `None` if there is none.

- **TopicRecord.end_time** (`int | None`) = `None`: Timestamp of the topic's latest message, in nanoseconds since the Unix epoch, or `None` if unknown.

- **TopicRecord.message_count** (`int | None`) = `None`: Number of messages in the topic, or `None` if unknown.

- **TopicRecord.message_paths** (`collections.abc.MutableSequence[MessagePathRecord]`) = `None`: Message paths of the topic.

- **TopicRecord.metadata** (`collections.abc.Mapping[str, Any]`) = `None`: Key-value metadata on the topic.

- **TopicRecord.modified** (`datetime.datetime`): Time the topic was last modified.

- **TopicRecord.modified_by** (`str`): ID of the user who last modified the topic.

- **TopicRecord.org_id** (`str`): ID of the organization that owns the topic.

- **TopicRecord.schema_checksum** (`str | None`) = `None`: Checksum of the topic's schema, or `None` if the topic has no known schema.

- **TopicRecord.schema_id** (`str | None`) = `None`: ID of the topic's schema, or `None` if the topic has no schema or Roboto has not yet recorded it.

- **TopicRecord.schema_name** (`str | None`) = `None`: Name of the topic's message type, such as `"sensor_msgs/PointCloud2"`, or `None` if it is unknown.

- **TopicRecord.start_time** (`int | None`) = `None`: Timestamp of the topic's earliest message, in nanoseconds since the Unix epoch, or `None` if unknown.

- **TopicRecord.topic_id** (`str`): Unique ID of the topic, beginning with `tp_`.

- **TopicRecord.topic_name** (`str`): Name of the topic, such as `"/imu/data"`.

### TopicSchemaRecord

```python
class roboto.domain.topics.record.TopicSchemaRecord(/, **data: Any)
```

`from roboto import TopicSchemaRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L688-L710)

Bases: `pydantic.BaseModel`

Topic schema, identified by its fields.

Within an organization, schemas with identical fields share one record, which a checksum of the fields identifies. `name` is not part of that identity: creating or ingesting a topic, or adding message paths to one, with a schema name and fields identical to this schema's replaces it with that schema name.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TopicSchemaRecord.checksum** (`str`): Checksum computed from the schema's fields; schemas with identical fields have the same checksum.
- **TopicSchemaRecord.created** (`datetime.datetime | None`) = `None`
- **TopicSchemaRecord.created_by** (`str`)
- **TopicSchemaRecord.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- **TopicSchemaRecord.modified** (`datetime.datetime | None`) = `None`
- **TopicSchemaRecord.modified_by** (`str`)
- **TopicSchemaRecord.name** (`str | None`) = `None`: Informational name of the schema, such as `"sensor_msgs/PointCloud2"`; not part of its identity.
- **TopicSchemaRecord.org_id** (`str`)
- **TopicSchemaRecord.schema_id** (`str`): Unique ID of the schema.

### TopicTimeBounds

```python
class roboto.domain.topics.record.TopicTimeBounds(/, **data: Any)
```

`from roboto.domain.topics import TopicTimeBounds`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L580-L598)

Bases: `pydantic.BaseModel`

Response body of [`get_topic_time_bounds()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.get_topic_time_bounds).

[`get_time_bounds_by_association()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.get_time_bounds_by_association) also returns it. It holds the earliest start time and latest end time across a set of topics, such as the topics of a dataset. Roboto computes the bounds, so a caller does not have to page through every topic to find them.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TopicTimeBounds.end_time** (`int | None`) = `None`: Latest `end_time` of a topic in the set, in nanoseconds since the Unix epoch.

  `None` when no topic in the set has an `end_time`, which includes an empty set.

- **TopicTimeBounds.start_time** (`int | None`) = `None`: Earliest `start_time` of a topic in the set, in nanoseconds since the Unix epoch.

  `None` when no topic in the set has a `start_time`, which includes an empty set.

### TransformationKind

```python
class roboto.domain.topics.record.TransformationKind
```

`from roboto.domain.topics import TransformationKind`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L125-L169)

Bases: `roboto.compat.StrEnum`

Kind of transformation applied to a topic's data to produce a representation of it.

A representation lists each transformation applied to it in `RepresentationRecord.transformations`, as a `"<kind>:<param>"` string such as `"downsample:0.5"` or `"encode:jpeg"`. This enum lists the kinds; the form of the parameter depends on the kind. Build these strings with `with_param` and split them with `parse`.

**Attributes**

- **TransformationKind.DOWNSAMPLE** = `'downsample'`: Spatial or temporal downsampling. The parameter is a scale factor in `(0, 1]`.
- **TransformationKind.ENCODE** = `'encode'`: Re-encoding into another content format. The parameter is the target format, such as `"jpeg"`.

#### TransformationKind.parse()

```python
@classmethod
def parse(descriptor: str) -> tuple[TransformationKind, str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L151-L169)

Split a `"<kind>:<param>"` transformation string into its kind and its parameter.

**Parameters**

- **descriptor** (`str`): Transformation string, such as `"encode:jpeg"`.

**Returns**

- `tuple[TransformationKind, str]`: `(kind, param)`: the kind and the parameter as a string. The parameter is empty when `descriptor` contains no `:`.

**Raises**

- `ValueError`: The text before the first `:` is not a `TransformationKind` value.

**Usage**

```python
TransformationKind.parse("encode:jpeg")
# (<TransformationKind.ENCODE: 'encode'>, 'jpeg')
```

#### TransformationKind.with_param()

```python
def with_param(param: object) -> str
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L138-L148)

Build the `"<kind>:<param>"` transformation string for this kind and `param`.

**Parameters**

- **param** (`object`): Parameter of the transformation, converted to a string.

**Returns**

- `str`

**Usage**

```python
TransformationKind.DOWNSAMPLE.with_param(0.5)
# 'downsample:0.5'
```

### validate_data_range()

```python
def roboto.domain.topics.record.validate_data_range(
    data_range: tuple[int, int],
) -> tuple[int, int]
```

`from roboto.domain.topics.record import validate_data_range`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/record.py#L605-L632)

Reject a `data_range` that is not a pair of non-negative positions with `start < end`.

Pydantic calls this while it builds a model with a `DataRange` field, such as a topic partition record. Both positions must also fit in a signed 64-bit integer, which is how Roboto stores them.

**Parameters**

- **data_range** (`tuple[int, int]`): The `(start, end)` pair to check, with `start` included and `end` excluded.

**Returns**

- `tuple[int, int]`: `data_range`, unchanged.

**Raises**

- `ValueError`: `start` is negative, `end` is not greater than `start`, or a position is too large for a signed 64-bit integer.
