Skip to content

sift_client.resources.channels

CLASS DESCRIPTION
ChannelsAPIAsync

High-level API for interacting with channels.

ChannelsAPIAsync

ChannelsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with channels.

This class provides a Pythonic, notebook-friendly interface for interacting with the ChannelsAPI. It handles automatic handling of gRPC services, seamless type conversion, and clear error handling.

All methods in this class use the Channel class from the low-level wrapper, which is a user-friendly representation of a channel using standard Python data structures and types.

Initialize the ChannelsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
find

Find a single channel matching the given query. Takes the same arguments as list. If more than one channel is found,

get

Get a Channel.

get_data

Get data for one or more channels.

get_data_as_arrow

Get data for one or more channels as pyarrow tables.

list_

List channels with optional filtering.

ATTRIBUTE DESCRIPTION
client

TYPE: SiftClient

grpc_client

TYPE: GrpcClient

rest_client

TYPE: RestClient

client property

client: SiftClient

grpc_client property

grpc_client: GrpcClient

rest_client property

rest_client: RestClient

find async

find(**kwargs) -> Channel | None

Find a single channel matching the given query. Takes the same arguments as list. If more than one channel is found, raises an error.

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
Channel | None

The Channel found or None.

get async

get(*, channel_id: str) -> Channel

Get a Channel.

PARAMETER DESCRIPTION
channel_id

The ID of the channel.

TYPE: str

RETURNS DESCRIPTION
Channel

The Channel.

get_data async

get_data(
    *,
    channels: list[Channel],
    run: Run | str | None = None,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
    limit: int | None = None,
    ignore_cache: bool = False,
) -> dict[str, DataFrame]

Get data for one or more channels.

PARAMETER DESCRIPTION
channels

The channels to get data for.

TYPE: list[Channel]

run

The Run or run_id to get data for.

TYPE: Run | str | None DEFAULT: None

start_time

The start time to get data for.

TYPE: datetime | None DEFAULT: None

end_time

The end time to get data for.

TYPE: datetime | None DEFAULT: None

limit

The maximum number of data points to return. Will be in increments of page_size or default page size defined by the call if no page_size is provided.

TYPE: int | None DEFAULT: None

ignore_cache

Whether to ignore cached data and fetch fresh data from the server.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
dict[str, DataFrame]

A dictionary mapping channel names to pandas DataFrames containing the channel data.

get_data_as_arrow async

get_data_as_arrow(
    *,
    channels: list[Channel],
    run: Run | str | None = None,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
    limit: int | None = None,
    ignore_cache: bool = False,
) -> dict[str, Table]

Get data for one or more channels as pyarrow tables.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    channel_ids: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    asset: Asset | str | None = None,
    assets: list[str | Asset] | None = None,
    run: Run | str | None = None,
    description_contains: str | None = None,
    include_archived: bool | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Channel]

List channels with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the channel.

TYPE: str | None DEFAULT: None

names

List of channel names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the channel.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter channels by name.

TYPE: str | Pattern | None DEFAULT: None

channel_ids

Filter to channels with any of these IDs.

TYPE: list[str] | None DEFAULT: None

created_after

Filter channels created after this datetime. Note: This is related to the channel creation time, not the timestamp of the underlying data.

TYPE: datetime | None DEFAULT: None

created_before

Filter channels created before this datetime. Note: This is related to the channel creation time, not the timestamp of the underlying data.

TYPE: datetime | None DEFAULT: None

modified_after

Filter channels modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter channels modified before this datetime.

TYPE: datetime | None DEFAULT: None

asset

Filter channels associated with this Asset or asset ID.

TYPE: Asset | str | None DEFAULT: None

assets

Filter channels associated with these Assets or asset IDs.

TYPE: list[str | Asset] | None DEFAULT: None

run

Filter channels associated with this Run or run ID.

TYPE: Run | str | None DEFAULT: None

description_contains

Partial description of the channel.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived channels in results.

TYPE: bool | None DEFAULT: None

filter_query

Explicit CEL query to filter channels.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

Maximum number of channels to return. If None, returns all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Channel]

A list of Channels that matches the filter criteria.