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

### Timestamp

```python
type roboto.domain.topics.topic_reader.Timestamp = typing.Union[int, float]
```

`from roboto.domain.topics import Timestamp`

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

### TopicReader

```python
class roboto.domain.topics.topic_reader.TopicReader
```

`from roboto.domain.topics.topic_reader import TopicReader`

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

Bases: `abc.ABC`

Private interface for retrieving topic data of a particular format.

> **Note**
>
> This is not intended as a public API. To access topic data, prefer the `get_data` or `get_data_as_df` methods on [`Topic`](/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic), [`MessagePath`](/reference/python-sdk/roboto/domain/topics/message_path#roboto.domain.topics.message_path.MessagePath), or [`Event`](/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event).

#### TopicReader.accepts()

```python
@staticmethod
@abstractmethod
def accepts(
    message_paths_to_representations: collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping],
) -> bool
```

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

**Parameters**

- **message_paths_to_representations** (`collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping]`)

**Returns**

- `bool`

#### TopicReader.get_data()

```python
@abstractmethod
def get_data(
    message_paths_to_representations: collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping],
    start_time: Optional[int] = None,
    end_time: Optional[int] = None,
    timestamp_message_path_representation_mapping: Optional[roboto.domain.topics.record.MessagePathRepresentationMapping] = None,
) -> collections.abc.Generator[tuple[Timestamp, dict[str, Any]], None, None]
```

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

**Parameters**

- **message_paths_to_representations** (`collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping]`)
- **start_time** (`Optional[int]`)
- **end_time** (`Optional[int]`)
- **timestamp_message_path_representation_mapping** (`Optional[roboto.domain.topics.record.MessagePathRepresentationMapping]`)

**Returns**

- `collections.abc.Generator[tuple[Timestamp, dict[str, Any]], None, None]`

#### TopicReader.get_data_as_df()

```python
@abstractmethod
def get_data_as_df(
    message_paths_to_representations: collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping],
    start_time: Optional[int] = None,
    end_time: Optional[int] = None,
    timestamp_message_path_representation_mapping: Optional[roboto.domain.topics.record.MessagePathRepresentationMapping] = None,
) -> tuple[pandas.Series, pandas.DataFrame]
```

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

**Parameters**

- **message_paths_to_representations** (`collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping]`)
- **start_time** (`Optional[int]`)
- **end_time** (`Optional[int]`)
- **timestamp_message_path_representation_mapping** (`Optional[roboto.domain.topics.record.MessagePathRepresentationMapping]`)

**Returns**

- `tuple[pandas.Series, pandas.DataFrame]`
