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:
|
| METHOD | DESCRIPTION |
|---|---|
find |
Find a single channel matching the given query. Takes the same arguments as |
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:
|
grpc_client |
TYPE:
|
rest_client |
TYPE:
|
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
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:
|
| 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:
|
run
|
The Run or run_id to get data for.
TYPE:
|
start_time
|
The start time to get data for.
TYPE:
|
end_time
|
The end time to get data for.
TYPE:
|
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:
|
ignore_cache
|
Whether to ignore cached data and fetch fresh data from the server.
TYPE:
|
| 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:
|
names
|
List of channel names to filter by.
TYPE:
|
name_contains
|
Partial name of the channel.
TYPE:
|
name_regex
|
Regular expression to filter channels by name.
TYPE:
|
channel_ids
|
Filter to channels with any of these IDs.
TYPE:
|
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:
|
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:
|
modified_after
|
Filter channels modified after this datetime.
TYPE:
|
modified_before
|
Filter channels modified before this datetime.
TYPE:
|
asset
|
Filter channels associated with this Asset or asset ID.
TYPE:
|
assets
|
Filter channels associated with these Assets or asset IDs.
TYPE:
|
run
|
Filter channels associated with this Run or run ID.
TYPE:
|
description_contains
|
Partial description of the channel.
TYPE:
|
include_archived
|
If True, include archived channels in results.
TYPE:
|
filter_query
|
Explicit CEL query to filter channels.
TYPE:
|
order_by
|
Field and direction to order results by.
TYPE:
|
limit
|
Maximum number of channels to return. If None, returns all matches.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Channel]
|
A list of Channels that matches the filter criteria. |