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.

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_id: str | None = None,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
    limit: int | None = None,
) -> dict[str, DataFrame]

Get data for one or more channels.

PARAMETER DESCRIPTION
channels

The channels to get data for.

TYPE: list[Channel]

run_id

The run to get data for.

TYPE: 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

get_data_as_arrow async

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

Get data for one or more channels as pyarrow tables.

list_ async

list_(
    *,
    asset_id: str | None = None,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    description: str | None = None,
    description_contains: str | None = None,
    active: bool | None = None,
    run_id: str | None = None,
    run_name: str | None = None,
    client_key: str | None = None,
    created_before: datetime | None = None,
    created_after: datetime | None = None,
    modified_before: datetime | None = None,
    modified_after: datetime | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Channel]

List channels with optional filtering.

PARAMETER DESCRIPTION
asset_id

The asset ID to get.

TYPE: str | None DEFAULT: None

name

The name of the channel to get.

TYPE: str | None DEFAULT: None

name_contains

The partial name of the channel to get.

TYPE: str | None DEFAULT: None

name_regex

The regex name of the channel to get.

TYPE: str | Pattern | None DEFAULT: None

description

The description of the channel to get.

TYPE: str | None DEFAULT: None

description_contains

The partial description of the channel to get.

TYPE: str | None DEFAULT: None

active

Whether the channel is active.

TYPE: bool | None DEFAULT: None

run_id

The run ID to get.

TYPE: str | None DEFAULT: None

run_name

The name of the run to get.

TYPE: str | None DEFAULT: None

client_key

The client key of the run to get.

TYPE: str | None DEFAULT: None

created_before

The created date of the channel to get.

TYPE: datetime | None DEFAULT: None

created_after

The created date of the channel to get.

TYPE: datetime | None DEFAULT: None

modified_before

The modified date of the channel to get.

TYPE: datetime | None DEFAULT: None

modified_after

The modified date of the channel to get.

TYPE: datetime | None DEFAULT: None

order_by

How to order the retrieved channels.

TYPE: str | None DEFAULT: None

limit

How many channels to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Channel]

A list of Channels that matches the filter.