Skip to content

sift_client.resources

Sift Resources - API interfaces for interacting with Sift services.

This module provides high-level API interfaces for interacting with Sift resources. Each resource API provides methods for common operations like listing, getting, creating, updating, and archiving resources.

Overview

Resource APIs are the primary way to interact with Sift services. They provide:

  • Type-safe methods with full IDE autocomplete support
  • Automatic type conversion between protobuf and Python types
  • Flexible filtering using CEL (Common Expression Language) queries
  • Both sync and async versions of most APIs
  • Consistent interface across all resource types

Synchronous vs Asynchronous APIs

All resource APIs are available in both synchronous and asynchronous versions:

  • Synchronous APIs (e.g., AssetsAPI) - Ideal for scripts, notebooks, and simple applications
  • Asynchronous APIs (e.g., AssetsAPIAsync) - Ideal for high-performance applications with concurrent operations

Example Usage

from sift_client import SiftClient

client = SiftClient(api_key="...", grpc_url="...", rest_url="...")

# Synchronous API usage
asset = client.assets.get(asset_id="asset123")
runs = client.runs.list_(assets=[asset.id_], limit=10)

# Asynchronous API usage
async def get_data():
    asset = await client.async_.assets.get(asset_id="asset123")
    runs = await client.async_.runs.list_(assets=[asset.id_], limit=10)
    return asset, runs

Common Methods

Most resource APIs provide a consistent set of methods:

Query Methods

  • get() - Retrieve a single resource by ID or unique identifier
  • list_() - Retrieve multiple resources with optional filtering
  • find() - Find a single resource matching criteria (raises error if multiple found)

Modification Methods

  • create() - Create a new resource (where applicable)
  • update() - Update an existing resource
  • archive() - Archive a resource (soft delete)
  • unarchive() - Restore an archived resource

Filtering and Querying

Resource APIs support powerful filtering capabilities:

Common Filters

  • Name filters: name, name_contains, name_regex
  • Time filters: created_after, created_before, modified_after, modified_before
  • User filters: created_by, modified_by
  • Metadata filters: tags, metadata
  • Archive filters: include_archived

Resource-Specific Filters

Each resource API may have additional filters:

  • Runs: start_time_after, duration_greater_than, is_stopped
  • Channels: asset, run
  • Rules: asset_ids, asset_tag_ids

Example: Advanced Filtering

from datetime import datetime, timedelta

# Complex run query
runs = client.runs.list_(
    assets=["asset123"],
    start_time_after=datetime.now() - timedelta(days=7),
    duration_greater_than=timedelta(hours=1),
    is_stopped=True,
    tags=["production"],
    order_by="start_time desc",
    limit=20
)

# Channel search with regex
channels = client.channels.list_(
    asset="asset123",
    name_regex="sensor_[0-9]+_temp",
    limit=100
)

Data Retrieval

The ChannelsAPI provides methods for retrieving time-series data:

from datetime import datetime, timedelta

# Get channel data as pandas DataFrames
channels = client.channels.list_(asset="asset123", limit=5)
data = client.channels.get_data(
    channels=channels,
    run="run123",
    start_time=datetime.now() - timedelta(hours=1),
    end_time=datetime.now(),
    limit=10000
)

# data is a dict mapping channel names to DataFrames
for channel_name, df in data.items():
    print(f"{channel_name}: {len(df)} data points")
    print(df.head())

Async Context Usage

When using async APIs, ensure proper async context:

import asyncio
from sift_client import SiftClient

async def main():
    client = SiftClient(api_key="...", grpc_url="...", rest_url="...")

    # Use async_ accessor for async APIs
    assets = await client.async_.assets.list_(limit=10)

    # Concurrent operations
    asset_task = client.async_.assets.get(asset_id="asset123")
    runs_task = client.async_.runs.list_(limit=10)

    asset, runs = await asyncio.gather(asset_task, runs_task)

    return asset, runs

# Run the async function
result = asyncio.run(main())
MODULE DESCRIPTION
assets
calculated_channels
channels
file_attachments
ingestion
ping
reports
rules
runs
sync_stubs
tags
test_results
CLASS DESCRIPTION
AssetsAPI

Sync counterpart to AssetsAPIAsync.

AssetsAPIAsync

High-level API for interacting with assets.

CalculatedChannelsAPI

Sync counterpart to CalculatedChannelsAPIAsync.

CalculatedChannelsAPIAsync

High-level API for interacting with calculated channels.

ChannelsAPI

Sync counterpart to ChannelsAPIAsync.

ChannelsAPIAsync

High-level API for interacting with channels.

FileAttachmentsAPI

Sync counterpart to FileAttachmentsAPIAsync.

FileAttachmentsAPIAsync

High-level API for interacting with file attachments (remote files).

IngestionAPIAsync

High-level API for interacting with ingestion services.

PingAPI

Sync counterpart to PingAPIAsync.

PingAPIAsync

High-level API for performing health checks.

ReportsAPI

Sync counterpart to ReportsAPIAsync.

ReportsAPIAsync

High-level API for interacting with reports.

RulesAPI

Sync counterpart to RulesAPIAsync.

RulesAPIAsync

High-level API for interacting with rules.

RunsAPI

Sync counterpart to RunsAPIAsync.

RunsAPIAsync

High-level API for interacting with runs.

TagsAPI

Sync counterpart to TagsAPIAsync.

TagsAPIAsync

High-level API for interacting with tags.

TestResultsAPI

Sync counterpart to TestResultsAPIAsync.

TestResultsAPIAsync

High-level API for interacting with test reports, steps, and measurements.

AssetsAPI

AssetsAPI(sift_client: SiftClient)

Sync counterpart to AssetsAPIAsync.

High-level API for interacting with assets.

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

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

Initialize the AssetsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive an asset.

find

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

get

Get an Asset.

list_

List assets with optional filtering.

unarchive

Unarchive an asset.

update

Update an Asset.

archive

archive(
    asset: str | Asset, *, archive_runs: bool = False
) -> Asset

Archive an asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to archive.

TYPE: str | Asset

archive_runs

If True, archive all Runs associated with the Asset.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Asset

The archived Asset.

find

find(**kwargs) -> Asset | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
Asset | None

The Asset found or None.

get

get(
    *, asset_id: str | None = None, name: str | None = None
) -> Asset

Get an Asset.

PARAMETER DESCRIPTION
asset_id

The ID of the asset.

TYPE: str | None DEFAULT: None

name

The name of the asset.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Asset

The Asset.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    asset_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,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Asset]

List assets with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the asset.

TYPE: str | None DEFAULT: None

names

List of asset names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the asset.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter assets by name.

TYPE: str | Pattern | None DEFAULT: None

asset_ids

Filter to assets with any of these Ids.

TYPE: list[str] | None DEFAULT: None

created_after

Filter assets created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter assets created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter assets modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter assets modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter assets created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter assets last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter assets with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter assets by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

description_contains

Partial description of the asset.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived assets in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter assets.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Asset]

A list of Asset objects that match the filter criteria.

unarchive

unarchive(asset: str | Asset) -> Asset

Unarchive an asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to unarchive.

TYPE: str | Asset

RETURNS DESCRIPTION
Asset

The unarchived Asset.

update

update(
    asset: str | Asset, update: AssetUpdate | dict
) -> Asset

Update an Asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to update.

TYPE: str | Asset

update

Updates to apply to the Asset.

TYPE: AssetUpdate | dict

RETURNS DESCRIPTION
Asset

The updated Asset.

AssetsAPIAsync

AssetsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with assets.

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

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

Initialize the AssetsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive an asset.

find

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

get

Get an Asset.

list_

List assets with optional filtering.

unarchive

Unarchive an asset.

update

Update an Asset.

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

archive async

archive(
    asset: str | Asset, *, archive_runs: bool = False
) -> Asset

Archive an asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to archive.

TYPE: str | Asset

archive_runs

If True, archive all Runs associated with the Asset.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Asset

The archived Asset.

find async

find(**kwargs) -> Asset | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
Asset | None

The Asset found or None.

get async

get(
    *, asset_id: str | None = None, name: str | None = None
) -> Asset

Get an Asset.

PARAMETER DESCRIPTION
asset_id

The ID of the asset.

TYPE: str | None DEFAULT: None

name

The name of the asset.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Asset

The Asset.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    asset_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,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Asset]

List assets with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the asset.

TYPE: str | None DEFAULT: None

names

List of asset names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the asset.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter assets by name.

TYPE: str | Pattern | None DEFAULT: None

asset_ids

Filter to assets with any of these Ids.

TYPE: list[str] | None DEFAULT: None

created_after

Filter assets created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter assets created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter assets modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter assets modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter assets created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter assets last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter assets with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter assets by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

description_contains

Partial description of the asset.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived assets in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter assets.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Asset]

A list of Asset objects that match the filter criteria.

unarchive async

unarchive(asset: str | Asset) -> Asset

Unarchive an asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to unarchive.

TYPE: str | Asset

RETURNS DESCRIPTION
Asset

The unarchived Asset.

update async

update(
    asset: str | Asset, update: AssetUpdate | dict
) -> Asset

Update an Asset.

PARAMETER DESCRIPTION
asset

The Asset or asset ID to update.

TYPE: str | Asset

update

Updates to apply to the Asset.

TYPE: AssetUpdate | dict

RETURNS DESCRIPTION
Asset

The updated Asset.

CalculatedChannelsAPI

CalculatedChannelsAPI(sift_client: SiftClient)

Sync counterpart to CalculatedChannelsAPIAsync.

High-level API for interacting with calculated channels.

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

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

Initialize the CalculatedChannelsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a calculated channel.

create

Create a calculated channel.

find

Find a single calculated channel matching the given query. Takes the same arguments as list but handles checking for multiple matches.

get

Get a Calculated Channel.

list_

List calculated channels with optional filtering. This will return the latest version. To find all versions, use list_versions.

list_versions

List versions of a calculated channel.

unarchive

Unarchive a calculated channel.

update

Update a Calculated Channel.

archive

archive(
    calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel

Archive a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The id or CalculatedChannel object of the calculated channel to archive.

TYPE: str | CalculatedChannel

RETURNS DESCRIPTION
CalculatedChannel

The archived CalculatedChannel.

create

create(
    create: CalculatedChannelCreate | dict,
) -> CalculatedChannel

Create a calculated channel.

PARAMETER DESCRIPTION
create

A CalculatedChannelCreate object or dictionary with configuration for the new calculated channel. This should include properties like name, expression, channel_references, etc.

TYPE: CalculatedChannelCreate | dict

RETURNS DESCRIPTION
CalculatedChannel

The created CalculatedChannel.

find

find(**kwargs) -> CalculatedChannel | None

Find a single calculated channel matching the given query. Takes the same arguments as list but handles checking for multiple matches. Will raise an error if multiple calculated channels are found.

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
CalculatedChannel | None

The CalculatedChannel found or None.

get

get(
    *,
    calculated_channel_id: str | None = None,
    client_key: str | None = None,
) -> CalculatedChannel

Get a Calculated Channel.

PARAMETER DESCRIPTION
calculated_channel_id

The ID of the calculated channel.

TYPE: str | None DEFAULT: None

client_key

The client key of the calculated channel.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
CalculatedChannel

The CalculatedChannel.

RAISES DESCRIPTION
ValueError

If neither calculated_channel_id nor client_key is provided.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    calculated_channel_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    asset: Asset | str | None = None,
    run: Run | str | None = None,
    version: int | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[CalculatedChannel]

List calculated channels with optional filtering. This will return the latest version. To find all versions, use list_versions.

PARAMETER DESCRIPTION
name

Exact name of the calculated channel.

TYPE: str | None DEFAULT: None

names

List of calculated channel names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the calculated channel.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter calculated channels by name.

TYPE: str | Pattern | None DEFAULT: None

calculated_channel_ids

Filter to calculated channels with any of these IDs.

TYPE: list[str] | None DEFAULT: None

client_keys

Filter to calculated channels with any of these client keys.

TYPE: list[str] | None DEFAULT: None

created_after

Created after this date.

TYPE: datetime | None DEFAULT: None

created_before

Created before this date.

TYPE: datetime | None DEFAULT: None

modified_after

Modified after this date.

TYPE: datetime | None DEFAULT: None

modified_before

Modified before this date.

TYPE: datetime | None DEFAULT: None

created_by

Calculated channels created by this user.

TYPE: Any | str | None DEFAULT: None

modified_by

Calculated channels last modified by this user.

TYPE: Any | str | None DEFAULT: None

tags

Filter calculated channels with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter calculated channels by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

asset

Filter calculated channels associated with this Asset or asset ID.

TYPE: Asset | str | None DEFAULT: None

run

Filter calculated channels associated with this Run or run ID.

TYPE: Run | str | None DEFAULT: None

version

The version of the calculated channel.

TYPE: int | None DEFAULT: None

description_contains

Partial description of the calculated channel.

TYPE: str | None DEFAULT: None

include_archived

Include archived calculated channels.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter calculated channels.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved calculated channels.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[CalculatedChannel]

A list of CalculatedChannels that matches the filter.

list_versions

list_versions(
    *,
    calculated_channel: CalculatedChannel
    | str
    | None = None,
    client_key: str | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[CalculatedChannel]

List versions of a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The CalculatedChannel or ID of the calculated channel to get versions for.

TYPE: CalculatedChannel | str | None DEFAULT: None

client_key

The client key of the calculated channel.

TYPE: str | None DEFAULT: None

name

Exact name of the calculated channel.

TYPE: str | None DEFAULT: None

names

List of calculated channel names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the calculated channel.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter calculated channels by name.

TYPE: str | Pattern | None DEFAULT: None

created_after

Filter versions created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter versions created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter versions modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter versions modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter versions created by this user or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter versions modified by this user or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter versions with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter versions by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

description_contains

Partial description of the calculated channel.

TYPE: str | None DEFAULT: None

include_archived

Include archived versions.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter versions.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved versions.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[CalculatedChannel]

A list of CalculatedChannel versions that match the filter criteria.

unarchive

unarchive(
    calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel

Unarchive a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The id or CalculatedChannel object of the calculated channel to unarchive.

TYPE: str | CalculatedChannel

RETURNS DESCRIPTION
CalculatedChannel

The unarchived CalculatedChannel.

update

update(
    calculated_channel: CalculatedChannel | str,
    update: CalculatedChannelUpdate | dict,
    *,
    user_notes: str | None = None,
) -> CalculatedChannel

Update a Calculated Channel.

PARAMETER DESCRIPTION
calculated_channel

The CalculatedChannel or id of the CalculatedChannel to update.

TYPE: CalculatedChannel | str

update

Updates to apply to the CalculatedChannel.

TYPE: CalculatedChannelUpdate | dict

user_notes

User notes for the update.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
CalculatedChannel

The updated CalculatedChannel.

CalculatedChannelsAPIAsync

CalculatedChannelsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with calculated channels.

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

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

Initialize the CalculatedChannelsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a calculated channel.

create

Create a calculated channel.

find

Find a single calculated channel matching the given query. Takes the same arguments as list but handles checking for multiple matches.

get

Get a Calculated Channel.

list_

List calculated channels with optional filtering. This will return the latest version. To find all versions, use list_versions.

list_versions

List versions of a calculated channel.

unarchive

Unarchive a calculated channel.

update

Update a Calculated Channel.

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

archive async

archive(
    calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel

Archive a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The id or CalculatedChannel object of the calculated channel to archive.

TYPE: str | CalculatedChannel

RETURNS DESCRIPTION
CalculatedChannel

The archived CalculatedChannel.

create async

create(
    create: CalculatedChannelCreate | dict,
) -> CalculatedChannel

Create a calculated channel.

PARAMETER DESCRIPTION
create

A CalculatedChannelCreate object or dictionary with configuration for the new calculated channel. This should include properties like name, expression, channel_references, etc.

TYPE: CalculatedChannelCreate | dict

RETURNS DESCRIPTION
CalculatedChannel

The created CalculatedChannel.

find async

find(**kwargs) -> CalculatedChannel | None

Find a single calculated channel matching the given query. Takes the same arguments as list but handles checking for multiple matches. Will raise an error if multiple calculated channels are found.

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
CalculatedChannel | None

The CalculatedChannel found or None.

get async

get(
    *,
    calculated_channel_id: str | None = None,
    client_key: str | None = None,
) -> CalculatedChannel

Get a Calculated Channel.

PARAMETER DESCRIPTION
calculated_channel_id

The ID of the calculated channel.

TYPE: str | None DEFAULT: None

client_key

The client key of the calculated channel.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
CalculatedChannel

The CalculatedChannel.

RAISES DESCRIPTION
ValueError

If neither calculated_channel_id nor client_key is provided.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    calculated_channel_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    asset: Asset | str | None = None,
    run: Run | str | None = None,
    version: int | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[CalculatedChannel]

List calculated channels with optional filtering. This will return the latest version. To find all versions, use list_versions.

PARAMETER DESCRIPTION
name

Exact name of the calculated channel.

TYPE: str | None DEFAULT: None

names

List of calculated channel names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the calculated channel.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter calculated channels by name.

TYPE: str | Pattern | None DEFAULT: None

calculated_channel_ids

Filter to calculated channels with any of these IDs.

TYPE: list[str] | None DEFAULT: None

client_keys

Filter to calculated channels with any of these client keys.

TYPE: list[str] | None DEFAULT: None

created_after

Created after this date.

TYPE: datetime | None DEFAULT: None

created_before

Created before this date.

TYPE: datetime | None DEFAULT: None

modified_after

Modified after this date.

TYPE: datetime | None DEFAULT: None

modified_before

Modified before this date.

TYPE: datetime | None DEFAULT: None

created_by

Calculated channels created by this user.

TYPE: Any | str | None DEFAULT: None

modified_by

Calculated channels last modified by this user.

TYPE: Any | str | None DEFAULT: None

tags

Filter calculated channels with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter calculated channels by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

asset

Filter calculated channels associated with this Asset or asset ID.

TYPE: Asset | str | None DEFAULT: None

run

Filter calculated channels associated with this Run or run ID.

TYPE: Run | str | None DEFAULT: None

version

The version of the calculated channel.

TYPE: int | None DEFAULT: None

description_contains

Partial description of the calculated channel.

TYPE: str | None DEFAULT: None

include_archived

Include archived calculated channels.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter calculated channels.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved calculated channels.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[CalculatedChannel]

A list of CalculatedChannels that matches the filter.

list_versions async

list_versions(
    *,
    calculated_channel: CalculatedChannel
    | str
    | None = None,
    client_key: str | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[Any] | list[str] | list[Tag] | None = None,
    metadata: list[Any] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[CalculatedChannel]

List versions of a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The CalculatedChannel or ID of the calculated channel to get versions for.

TYPE: CalculatedChannel | str | None DEFAULT: None

client_key

The client key of the calculated channel.

TYPE: str | None DEFAULT: None

name

Exact name of the calculated channel.

TYPE: str | None DEFAULT: None

names

List of calculated channel names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the calculated channel.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter calculated channels by name.

TYPE: str | Pattern | None DEFAULT: None

created_after

Filter versions created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter versions created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter versions modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter versions modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter versions created by this user or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter versions modified by this user or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter versions with any of these Tags or tag names.

TYPE: list[Any] | list[str] | list[Tag] | None DEFAULT: None

metadata

Filter versions by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

description_contains

Partial description of the calculated channel.

TYPE: str | None DEFAULT: None

include_archived

Include archived versions.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter versions.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved versions.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[CalculatedChannel]

A list of CalculatedChannel versions that match the filter criteria.

unarchive async

unarchive(
    calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel

Unarchive a calculated channel.

PARAMETER DESCRIPTION
calculated_channel

The id or CalculatedChannel object of the calculated channel to unarchive.

TYPE: str | CalculatedChannel

RETURNS DESCRIPTION
CalculatedChannel

The unarchived CalculatedChannel.

update async

update(
    calculated_channel: CalculatedChannel | str,
    update: CalculatedChannelUpdate | dict,
    *,
    user_notes: str | None = None,
) -> CalculatedChannel

Update a Calculated Channel.

PARAMETER DESCRIPTION
calculated_channel

The CalculatedChannel or id of the CalculatedChannel to update.

TYPE: CalculatedChannel | str

update

Updates to apply to the CalculatedChannel.

TYPE: CalculatedChannelUpdate | dict

user_notes

User notes for the update.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
CalculatedChannel

The updated CalculatedChannel.

ChannelsAPI

ChannelsAPI(sift_client: SiftClient)

Sync counterpart to ChannelsAPIAsync.

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

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

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

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

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_

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.

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.

FileAttachmentsAPI

FileAttachmentsAPI(sift_client: SiftClient)

Sync counterpart to FileAttachmentsAPIAsync.

High-level API for interacting with file attachments (remote files).

This class provides a Pythonic interface for managing file attachments on Sift entities like runs, assets, and test reports.

Initialize the FileAttachmentsAPIAsync.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
delete

Batch delete multiple file attachments.

download

Download a file attachment to a local path.

get

Get a file attachment by ID.

get_download_url

Get a download URL for a file attachment.

list_

List file attachments with optional filtering.

update

Update a file attachment.

upload

Upload a file attachment to a remote file.

delete

delete(
    *,
    file_attachments: list[FileAttachment | str]
    | FileAttachment
    | str,
) -> None

Batch delete multiple file attachments.

PARAMETER DESCRIPTION
file_attachments

List of FileAttachments or the IDs of the file attachments to delete (up to 1000).

TYPE: list[FileAttachment | str] | FileAttachment | str

download

download(
    *,
    file_attachment: FileAttachment | str,
    output_path: str | Path,
) -> None

Download a file attachment to a local path.

PARAMETER DESCRIPTION
file_attachment

The FileAttachment or the ID of the file attachment to download.

TYPE: FileAttachment | str

output_path

The path to download the file attachment to.

TYPE: str | Path

get

get(*, file_attachment_id: str) -> FileAttachment

Get a file attachment by ID.

PARAMETER DESCRIPTION
file_attachment_id

The ID of the file attachment to retrieve.

TYPE: str

RETURNS DESCRIPTION
FileAttachment

The FileAttachment.

get_download_url

get_download_url(
    *, file_attachment: FileAttachment | str
) -> str

Get a download URL for a file attachment.

PARAMETER DESCRIPTION
file_attachment

The FileAttachment or the ID of the file attachment.

TYPE: FileAttachment | str

RETURNS DESCRIPTION
str

The download URL for the file attachment.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    remote_file_ids: list[str] | None = None,
    entities: list[Run | Asset | TestReport] | None = None,
    entity_type: RemoteFileEntityType | None = None,
    entity_ids: list[str] | None = None,
    description_contains: str | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[FileAttachment]

List file attachments with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the file attachment.

TYPE: str | None DEFAULT: None

names

List of file attachment names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the file attachment.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter file attachments by name.

TYPE: str | Pattern | None DEFAULT: None

remote_file_ids

Filter to file attachments with any of these IDs.

TYPE: list[str] | None DEFAULT: None

entities

Filter to file attachments associated with these entities.

TYPE: list[Run | Asset | TestReport] | None DEFAULT: None

entity_type

Filter to file attachments associated with this entity type.

TYPE: RemoteFileEntityType | None DEFAULT: None

entity_ids

Filter to file attachments associated with these entity IDs.

TYPE: list[str] | None DEFAULT: None

description_contains

Partial description of the file attachment.

TYPE: str | None DEFAULT: None

filter_query

Explicit CEL query to filter file attachments.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by. Note: Not supported by the backend, but it is here for API consistency.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[FileAttachment]

A list of FileAttachment objects that match the filter criteria.

update

update(
    *, file_attachment: FileAttachmentUpdate | dict
) -> FileAttachment

Update a file attachment.

PARAMETER DESCRIPTION
file_attachment

The FileAttachmentUpdate with fields to update.

TYPE: FileAttachmentUpdate | dict

RETURNS DESCRIPTION
FileAttachment

The updated FileAttachment.

upload

upload(
    *,
    path: str | Path,
    entity: Asset | Run | TestReport,
    metadata: dict[str, Any] | None = None,
    description: str | None = None,
    organization_id: str | None = None,
) -> FileAttachment

Upload a file attachment to a remote file.

PARAMETER DESCRIPTION
path

The path to the file to upload.

TYPE: str | Path

entity

The entity that the file is attached to.

TYPE: Asset | Run | TestReport

metadata

Optional metadata for the file (e.g., video/image metadata).

TYPE: dict[str, Any] | None DEFAULT: None

description

Optional description of the file.

TYPE: str | None DEFAULT: None

organization_id

Optional organization ID.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
FileAttachment

The uploaded FileAttachment.

FileAttachmentsAPIAsync

FileAttachmentsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with file attachments (remote files).

This class provides a Pythonic interface for managing file attachments on Sift entities like runs, assets, and test reports.

Initialize the FileAttachmentsAPIAsync.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
delete

Batch delete multiple file attachments.

download

Download a file attachment to a local path.

get

Get a file attachment by ID.

get_download_url

Get a download URL for a file attachment.

list_

List file attachments with optional filtering.

update

Update a file attachment.

upload

Upload a file attachment to a remote file.

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

delete async

delete(
    *,
    file_attachments: list[FileAttachment | str]
    | FileAttachment
    | str,
) -> None

Batch delete multiple file attachments.

PARAMETER DESCRIPTION
file_attachments

List of FileAttachments or the IDs of the file attachments to delete (up to 1000).

TYPE: list[FileAttachment | str] | FileAttachment | str

download async

download(
    *,
    file_attachment: FileAttachment | str,
    output_path: str | Path,
) -> None

Download a file attachment to a local path.

PARAMETER DESCRIPTION
file_attachment

The FileAttachment or the ID of the file attachment to download.

TYPE: FileAttachment | str

output_path

The path to download the file attachment to.

TYPE: str | Path

get async

get(*, file_attachment_id: str) -> FileAttachment

Get a file attachment by ID.

PARAMETER DESCRIPTION
file_attachment_id

The ID of the file attachment to retrieve.

TYPE: str

RETURNS DESCRIPTION
FileAttachment

The FileAttachment.

get_download_url async

get_download_url(
    *, file_attachment: FileAttachment | str
) -> str

Get a download URL for a file attachment.

PARAMETER DESCRIPTION
file_attachment

The FileAttachment or the ID of the file attachment.

TYPE: FileAttachment | str

RETURNS DESCRIPTION
str

The download URL for the file attachment.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    remote_file_ids: list[str] | None = None,
    entities: list[Run | Asset | TestReport] | None = None,
    entity_type: RemoteFileEntityType | None = None,
    entity_ids: list[str] | None = None,
    description_contains: str | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[FileAttachment]

List file attachments with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the file attachment.

TYPE: str | None DEFAULT: None

names

List of file attachment names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the file attachment.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter file attachments by name.

TYPE: str | Pattern | None DEFAULT: None

remote_file_ids

Filter to file attachments with any of these IDs.

TYPE: list[str] | None DEFAULT: None

entities

Filter to file attachments associated with these entities.

TYPE: list[Run | Asset | TestReport] | None DEFAULT: None

entity_type

Filter to file attachments associated with this entity type.

TYPE: RemoteFileEntityType | None DEFAULT: None

entity_ids

Filter to file attachments associated with these entity IDs.

TYPE: list[str] | None DEFAULT: None

description_contains

Partial description of the file attachment.

TYPE: str | None DEFAULT: None

filter_query

Explicit CEL query to filter file attachments.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by. Note: Not supported by the backend, but it is here for API consistency.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[FileAttachment]

A list of FileAttachment objects that match the filter criteria.

update async

update(
    *, file_attachment: FileAttachmentUpdate | dict
) -> FileAttachment

Update a file attachment.

PARAMETER DESCRIPTION
file_attachment

The FileAttachmentUpdate with fields to update.

TYPE: FileAttachmentUpdate | dict

RETURNS DESCRIPTION
FileAttachment

The updated FileAttachment.

upload async

upload(
    *,
    path: str | Path,
    entity: Asset | Run | TestReport,
    metadata: dict[str, Any] | None = None,
    description: str | None = None,
    organization_id: str | None = None,
) -> FileAttachment

Upload a file attachment to a remote file.

PARAMETER DESCRIPTION
path

The path to the file to upload.

TYPE: str | Path

entity

The entity that the file is attached to.

TYPE: Asset | Run | TestReport

metadata

Optional metadata for the file (e.g., video/image metadata).

TYPE: dict[str, Any] | None DEFAULT: None

description

Optional description of the file.

TYPE: str | None DEFAULT: None

organization_id

Optional organization ID.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
FileAttachment

The uploaded FileAttachment.

IngestionAPIAsync

IngestionAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with ingestion services.

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

All methods in this class use the Flow class from the types module, which is a user-friendly representation of ingestion flows using standard Python data structures and types.

Initialize the IngestionAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
create_ingestion_config_streaming_client

Create an IngestionConfigStreamingClient.

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

create_ingestion_config_streaming_client async

create_ingestion_config_streaming_client(
    ingestion_config: IngestionConfig
    | IngestionConfigCreate
    | IngestionConfigFormPy,
    *,
    run: RunCreate | dict | str | Run | None = None,
    asset_tags: list[str] | list[Tag] | None = None,
    asset_metadata: dict[str, str | float | bool]
    | None = None,
    recovery_strategy: RecoveryStrategyConfig
    | RecoveryStrategyPy
    | None = None,
    checkpoint_interval_seconds: int | None = None,
    enable_tls: bool = True,
    tracing_config: TracingConfig | None = None,
) -> IngestionConfigStreamingClient

Create an IngestionConfigStreamingClient.

PARAMETER DESCRIPTION
ingestion_config

The ingestion config. Can be a IngestionConfig or IngestionConfigFormPy.

TYPE: IngestionConfig | IngestionConfigCreate | IngestionConfigFormPy

run

The run to associate with ingestion. Can be a Run, RunCreate, dict, or run ID string.

TYPE: RunCreate | dict | str | Run | None DEFAULT: None

asset_tags

Tags to associate with the asset.

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

asset_metadata

Metadata to associate with the asset.

TYPE: dict[str, str | float | bool] | None DEFAULT: None

recovery_strategy

The recovery strategy to use for ingestion.

TYPE: RecoveryStrategyConfig | RecoveryStrategyPy | None DEFAULT: None

checkpoint_interval_seconds

The checkpoint interval in seconds.

TYPE: int | None DEFAULT: None

enable_tls

Whether to enable TLS for the connection.

TYPE: bool DEFAULT: True

tracing_config

Configuration for SiftStream tracing. Use TracingConfig.stdout_only() to enable tracing to stdout only, or TracingConfig.stdout_with_file() to enable tracing to both stdout and rolling log files. Defaults to None (tracing will be initialized with default settings if not already initialized).

TYPE: TracingConfig | None DEFAULT: None

RETURNS DESCRIPTION
IngestionConfigStreamingClient

An initialized IngestionConfigStreamingClient.

PingAPI

PingAPI(sift_client: SiftClient)

Sync counterpart to PingAPIAsync.

High-level API for performing health checks.

Initialize the AssetsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
ping

Send a ping request to the server.

ping

ping() -> str

Send a ping request to the server.

RETURNS DESCRIPTION
str

The response from the server.

PingAPIAsync

PingAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for performing health checks.

Initialize the AssetsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
ping

Send a ping request to the server.

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

ping async

ping() -> str

Send a ping request to the server.

RETURNS DESCRIPTION
str

The response from the server.

ReportsAPI

ReportsAPI(sift_client: SiftClient)

Sync counterpart to ReportsAPIAsync.

High-level API for interacting with reports.

Initialize the ReportsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a report.

cancel

Cancel a report.

create_from_applicable_rules

Create a new report from applicable rules based on a run.

create_from_rules

Create a new report from rules.

create_from_template

Create a new report from a report template.

find

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

get

Get a Report.

list_

List reports with optional filtering.

rerun

Rerun a report.

unarchive

Unarchive a report.

update

Update a report.

archive

archive(*, report: str | Report) -> Report

Archive a report.

cancel

cancel(*, report: str | Report) -> None

Cancel a report.

PARAMETER DESCRIPTION
report

The Report or report ID to cancel.

TYPE: str | Report

create_from_applicable_rules

create_from_applicable_rules(
    *,
    run: Run | str | None = None,
    organization_id: str | None = None,
    name: str | None = None,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
) -> Report | None

Create a new report from applicable rules based on a run. If you want to evaluate against assets, use the rules client instead since no report is created in that case.

PARAMETER DESCRIPTION
run

The run or run ID to associate with the report.

TYPE: Run | str | None DEFAULT: None

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

name

Optional name for the report.

TYPE: str | None DEFAULT: None

start_time

Optional start time to evaluate rules against.

TYPE: datetime | None DEFAULT: None

end_time

Optional end time to evaluate rules against.

TYPE: datetime | None DEFAULT: None

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

create_from_rules

create_from_rules(
    *,
    name: str,
    run: Run | str | None = None,
    organization_id: str | None = None,
    rules: list[Rule] | list[str],
) -> Report | None

Create a new report from rules.

PARAMETER DESCRIPTION
name

The name of the report.

TYPE: str

run

The run or run ID to associate with the report.

TYPE: Run | str | None DEFAULT: None

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

rules

List of rules or rule IDs to include in the report.

TYPE: list[Rule] | list[str]

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

create_from_template

create_from_template(
    *,
    report_template_id: str,
    run_id: str,
    organization_id: str | None = None,
    name: str | None = None,
) -> Report | None

Create a new report from a report template.

PARAMETER DESCRIPTION
report_template_id

The ID of the report template to use.

TYPE: str

run_id

The run ID to associate with the report.

TYPE: str

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

name

Optional name for the report.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

find

find(**kwargs) -> Report | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Report | None

The Report found or None.

get

get(*, report_id: str) -> Report

Get a Report.

PARAMETER DESCRIPTION
report_id

The ID of the report.

TYPE: str

RETURNS DESCRIPTION
Report

The Report.

list_

list_(
    *,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    names: list[str] | None = None,
    description_contains: str | None = None,
    run: Run | str | None = None,
    organization_id: str | None = None,
    report_ids: list[str] | None = None,
    report_template_id: str | None = None,
    metadata: dict[str, str | float | bool] | None = None,
    tag_names: list[str] | list[Tag] | None = None,
    created_by: str | None = None,
    modified_by: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
) -> list[Report]

List reports with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the report.

TYPE: str | None DEFAULT: None

name_contains

Partial name of the report.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter reports by name.

TYPE: str | Pattern | None DEFAULT: None

names

List of report names to filter by.

TYPE: list[str] | None DEFAULT: None

description_contains

Partial description of the report.

TYPE: str | None DEFAULT: None

run

Run/run ID to filter by.

TYPE: Run | str | None DEFAULT: None

organization_id

Organization ID to filter by.

TYPE: str | None DEFAULT: None

report_ids

List of report IDs to filter by.

TYPE: list[str] | None DEFAULT: None

report_template_id

Report template ID to filter by.

TYPE: str | None DEFAULT: None

metadata

Metadata to filter by.

TYPE: dict[str, str | float | bool] | None DEFAULT: None

tag_names

List of tags or tag names to filter by.

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

created_by

The user ID of the creator of the reports.

TYPE: str | None DEFAULT: None

modified_by

The user ID of the last modifier of the reports.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved reports.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

include_archived

Whether to include archived reports.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter reports.

TYPE: str | None DEFAULT: None

created_after

Filter reports created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter reports created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter reports modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter reports modified before this datetime.

TYPE: datetime | None DEFAULT: None

RETURNS DESCRIPTION
list[Report]

A list of Reports that matches the filter.

rerun

rerun(*, report: str | Report) -> tuple[str, str]

Rerun a report.

PARAMETER DESCRIPTION
report

The Report or report ID to rerun.

TYPE: str | Report

RETURNS DESCRIPTION
tuple[str, str]

A tuple of (job_id, new_report_id).

unarchive

unarchive(*, report: str | Report) -> Report

Unarchive a report.

update

update(
    report: str | Report, update: ReportUpdate | dict
) -> Report

Update a report.

PARAMETER DESCRIPTION
report

The Report or report ID to update.

TYPE: str | Report

update

The updates to apply.

TYPE: ReportUpdate | dict

ReportsAPIAsync

ReportsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with reports.

Initialize the ReportsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a report.

cancel

Cancel a report.

create_from_applicable_rules

Create a new report from applicable rules based on a run.

create_from_rules

Create a new report from rules.

create_from_template

Create a new report from a report template.

find

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

get

Get a Report.

list_

List reports with optional filtering.

rerun

Rerun a report.

unarchive

Unarchive a report.

update

Update a report.

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

archive async

archive(*, report: str | Report) -> Report

Archive a report.

cancel async

cancel(*, report: str | Report) -> None

Cancel a report.

PARAMETER DESCRIPTION
report

The Report or report ID to cancel.

TYPE: str | Report

create_from_applicable_rules async

create_from_applicable_rules(
    *,
    run: Run | str | None = None,
    organization_id: str | None = None,
    name: str | None = None,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
) -> Report | None

Create a new report from applicable rules based on a run. If you want to evaluate against assets, use the rules client instead since no report is created in that case.

PARAMETER DESCRIPTION
run

The run or run ID to associate with the report.

TYPE: Run | str | None DEFAULT: None

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

name

Optional name for the report.

TYPE: str | None DEFAULT: None

start_time

Optional start time to evaluate rules against.

TYPE: datetime | None DEFAULT: None

end_time

Optional end time to evaluate rules against.

TYPE: datetime | None DEFAULT: None

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

create_from_rules async

create_from_rules(
    *,
    name: str,
    run: Run | str | None = None,
    organization_id: str | None = None,
    rules: list[Rule] | list[str],
) -> Report | None

Create a new report from rules.

PARAMETER DESCRIPTION
name

The name of the report.

TYPE: str

run

The run or run ID to associate with the report.

TYPE: Run | str | None DEFAULT: None

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

rules

List of rules or rule IDs to include in the report.

TYPE: list[Rule] | list[str]

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

create_from_template async

create_from_template(
    *,
    report_template_id: str,
    run_id: str,
    organization_id: str | None = None,
    name: str | None = None,
) -> Report | None

Create a new report from a report template.

PARAMETER DESCRIPTION
report_template_id

The ID of the report template to use.

TYPE: str

run_id

The run ID to associate with the report.

TYPE: str

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

name

Optional name for the report.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Report | None

The created Report or None if no report was created.

find async

find(**kwargs) -> Report | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Report | None

The Report found or None.

get async

get(*, report_id: str) -> Report

Get a Report.

PARAMETER DESCRIPTION
report_id

The ID of the report.

TYPE: str

RETURNS DESCRIPTION
Report

The Report.

list_ async

list_(
    *,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    names: list[str] | None = None,
    description_contains: str | None = None,
    run: Run | str | None = None,
    organization_id: str | None = None,
    report_ids: list[str] | None = None,
    report_template_id: str | None = None,
    metadata: dict[str, str | float | bool] | None = None,
    tag_names: list[str] | list[Tag] | None = None,
    created_by: str | None = None,
    modified_by: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
) -> list[Report]

List reports with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the report.

TYPE: str | None DEFAULT: None

name_contains

Partial name of the report.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter reports by name.

TYPE: str | Pattern | None DEFAULT: None

names

List of report names to filter by.

TYPE: list[str] | None DEFAULT: None

description_contains

Partial description of the report.

TYPE: str | None DEFAULT: None

run

Run/run ID to filter by.

TYPE: Run | str | None DEFAULT: None

organization_id

Organization ID to filter by.

TYPE: str | None DEFAULT: None

report_ids

List of report IDs to filter by.

TYPE: list[str] | None DEFAULT: None

report_template_id

Report template ID to filter by.

TYPE: str | None DEFAULT: None

metadata

Metadata to filter by.

TYPE: dict[str, str | float | bool] | None DEFAULT: None

tag_names

List of tags or tag names to filter by.

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

created_by

The user ID of the creator of the reports.

TYPE: str | None DEFAULT: None

modified_by

The user ID of the last modifier of the reports.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved reports.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

include_archived

Whether to include archived reports.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter reports.

TYPE: str | None DEFAULT: None

created_after

Filter reports created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter reports created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter reports modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter reports modified before this datetime.

TYPE: datetime | None DEFAULT: None

RETURNS DESCRIPTION
list[Report]

A list of Reports that matches the filter.

rerun async

rerun(*, report: str | Report) -> tuple[str, str]

Rerun a report.

PARAMETER DESCRIPTION
report

The Report or report ID to rerun.

TYPE: str | Report

RETURNS DESCRIPTION
tuple[str, str]

A tuple of (job_id, new_report_id).

unarchive async

unarchive(*, report: str | Report) -> Report

Unarchive a report.

update async

update(
    report: str | Report, update: ReportUpdate | dict
) -> Report

Update a report.

PARAMETER DESCRIPTION
report

The Report or report ID to update.

TYPE: str | Report

update

The updates to apply.

TYPE: ReportUpdate | dict

RulesAPI

RulesAPI(sift_client: SiftClient)

Sync counterpart to RulesAPIAsync.

High-level API for interacting with rules.

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

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

Initialize the RulesAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a rule.

create

Create a new rule.

find

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

get

Get a Rule.

list_

List rules with optional filtering.

unarchive

Unarchive a rule.

update

Update a Rule.

archive

archive(rule: str | Rule) -> Rule

Archive a rule.

PARAMETER DESCRIPTION
rule

The id or Rule object of the rule to archive.

TYPE: str | Rule

RETURNS DESCRIPTION
Rule

The archived Rule.

create

create(create: RuleCreate | dict) -> Rule

Create a new rule.

PARAMETER DESCRIPTION
create

A RuleCreate object or dictionary with configuration for the new rule.

TYPE: RuleCreate | dict

RETURNS DESCRIPTION
Rule

The created Rule.

find

find(**kwargs) -> Rule | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Rule | None

The Rule found or None.

get

get(
    *,
    rule_id: str | None = None,
    client_key: str | None = None,
) -> Rule

Get a Rule.

PARAMETER DESCRIPTION
rule_id

The ID of the rule.

TYPE: str | None DEFAULT: None

client_key

The client key of the rule.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Rule

The Rule.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    rule_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    metadata: list[Any] | None = None,
    assets: list[str] | list[Asset] | None = None,
    asset_tags: list[str | Tag] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Rule]

List rules with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the rule.

TYPE: str | None DEFAULT: None

names

List of rule names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the rule.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter rules by name.

TYPE: str | Pattern | None DEFAULT: None

client_keys

Client keys of rules to filter to.

TYPE: list[str] | None DEFAULT: None

rule_ids

IDs of rules to filter to.

TYPE: list[str] | None DEFAULT: None

created_after

Rules created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Rules created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Rules modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Rules modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter rules created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter rules last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

metadata

Filter rules by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

assets

Filter rules associated with any of these Assets.

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

asset_tags

Filter rules associated with any Assets that have these Tag IDs.

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

description_contains

Partial description of the rule.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived rules in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter rules.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Rule]

A list of Rules that matches the filter.

unarchive

unarchive(rule: str | Rule) -> Rule

Unarchive a rule.

PARAMETER DESCRIPTION
rule

The id or Rule object of the rule to unarchive.

TYPE: str | Rule

RETURNS DESCRIPTION
Rule

The unarchived Rule.

update

update(
    rule: Rule | str,
    update: RuleUpdate | dict,
    *,
    version_notes: str | None = None,
) -> Rule

Update a Rule.

PARAMETER DESCRIPTION
rule

The Rule or rule ID to update.

TYPE: Rule | str

update

Updates to apply to the Rule.

TYPE: RuleUpdate | dict

version_notes

Notes to include in the rule version.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Rule

The updated Rule.

RulesAPIAsync

RulesAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with rules.

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

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

Initialize the RulesAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a rule.

create

Create a new rule.

find

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

get

Get a Rule.

list_

List rules with optional filtering.

unarchive

Unarchive a rule.

update

Update a Rule.

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

archive async

archive(rule: str | Rule) -> Rule

Archive a rule.

PARAMETER DESCRIPTION
rule

The id or Rule object of the rule to archive.

TYPE: str | Rule

RETURNS DESCRIPTION
Rule

The archived Rule.

create async

create(create: RuleCreate | dict) -> Rule

Create a new rule.

PARAMETER DESCRIPTION
create

A RuleCreate object or dictionary with configuration for the new rule.

TYPE: RuleCreate | dict

RETURNS DESCRIPTION
Rule

The created Rule.

find async

find(**kwargs) -> Rule | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Rule | None

The Rule found or None.

get async

get(
    *,
    rule_id: str | None = None,
    client_key: str | None = None,
) -> Rule

Get a Rule.

PARAMETER DESCRIPTION
rule_id

The ID of the rule.

TYPE: str | None DEFAULT: None

client_key

The client key of the rule.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Rule

The Rule.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    rule_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    metadata: list[Any] | None = None,
    assets: list[str] | list[Asset] | None = None,
    asset_tags: list[str | Tag] | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Rule]

List rules with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the rule.

TYPE: str | None DEFAULT: None

names

List of rule names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the rule.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter rules by name.

TYPE: str | Pattern | None DEFAULT: None

client_keys

Client keys of rules to filter to.

TYPE: list[str] | None DEFAULT: None

rule_ids

IDs of rules to filter to.

TYPE: list[str] | None DEFAULT: None

created_after

Rules created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Rules created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Rules modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Rules modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter rules created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter rules last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

metadata

Filter rules by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

assets

Filter rules associated with any of these Assets.

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

asset_tags

Filter rules associated with any Assets that have these Tag IDs.

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

description_contains

Partial description of the rule.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived rules in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter rules.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Rule]

A list of Rules that matches the filter.

unarchive async

unarchive(rule: str | Rule) -> Rule

Unarchive a rule.

PARAMETER DESCRIPTION
rule

The id or Rule object of the rule to unarchive.

TYPE: str | Rule

RETURNS DESCRIPTION
Rule

The unarchived Rule.

update async

update(
    rule: Rule | str,
    update: RuleUpdate | dict,
    *,
    version_notes: str | None = None,
) -> Rule

Update a Rule.

PARAMETER DESCRIPTION
rule

The Rule or rule ID to update.

TYPE: Rule | str

update

Updates to apply to the Rule.

TYPE: RuleUpdate | dict

version_notes

Notes to include in the rule version.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Rule

The updated Rule.

RunsAPI

RunsAPI(sift_client: SiftClient)

Sync counterpart to RunsAPIAsync.

High-level API for interacting with runs.

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

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

Initialize the RunsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a run.

create

Create a new run.

find

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

get

Get a Run.

list_

List runs with optional filtering.

stop

Stop a run by setting its stop time to the current time.

unarchive

Unarchive a run.

update

Update a Run.

archive

archive(run: str | Run) -> Run

Archive a run.

PARAMETER DESCRIPTION
run

The Run or run ID to archive.

TYPE: str | Run

create

create(
    create: RunCreate | dict,
    assets: list[str | Asset] | None = None,
    associate_new_data: bool = False,
) -> Run

Create a new run.

Note on assets: You do not need to provide asset info when creating a run. If you pass a Run to future ingestion configs associated with assets, the association will happen automatically then. However, if you do pass assets and set associate_new_data=True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run. This may be useful if you want to capture a time range for a specific asset or won't know about this Run when ingesting to that asset. If the data has already been ingested, leave associate_new_data=False.

PARAMETER DESCRIPTION
create

The Run definition to create.

TYPE: RunCreate | dict

assets

List of assets to associate with the run. Note: if you are associating new data, you must provide assets/asset names.

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

associate_new_data

If True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Run

The created Run.

find

find(**kwargs) -> Run | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
Run | None

The Run found or None.

get

get(
    *,
    run_id: str | None = None,
    client_key: str | None = None,
) -> Run

Get a Run.

PARAMETER DESCRIPTION
run_id

The ID of the run.

TYPE: str | None DEFAULT: None

client_key

The client key of the run.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Run

The Run.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    run_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[str | Tag] | None = None,
    metadata: list[Any] | None = None,
    assets: list[Asset] | list[str] | None = None,
    asset_tags: list[str | Tag] | None = None,
    duration_less_than: timedelta | None = None,
    duration_greater_than: timedelta | None = None,
    start_time_after: datetime | None = None,
    start_time_before: datetime | None = None,
    stop_time_after: datetime | None = None,
    stop_time_before: datetime | None = None,
    is_stopped: bool | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Run]

List runs with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the run.

TYPE: str | None DEFAULT: None

names

List of run names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the run.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter runs by name.

TYPE: str | Pattern | None DEFAULT: None

run_ids

Filter to runs with any of these IDs.

TYPE: list[str] | None DEFAULT: None

client_keys

Filter to runs with any of these client keys.

TYPE: list[str] | None DEFAULT: None

created_after

Filter runs created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter runs created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter runs modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter runs modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter runs created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter runs last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter runs with any of these Tags IDs.

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

metadata

Filter runs by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

assets

Filter runs associated with any of these Assets or asset IDs.

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

asset_tags

Filter runs associated with any Assets that have these Tag IDs.

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

duration_less_than

Filter runs with duration less than this time.

TYPE: timedelta | None DEFAULT: None

duration_greater_than

Filter runs with duration greater than this time.

TYPE: timedelta | None DEFAULT: None

start_time_after

Filter runs that started after this datetime.

TYPE: datetime | None DEFAULT: None

start_time_before

Filter runs that started before this datetime.

TYPE: datetime | None DEFAULT: None

stop_time_after

Filter runs that stopped after this datetime.

TYPE: datetime | None DEFAULT: None

stop_time_before

Filter runs that stopped before this datetime.

TYPE: datetime | None DEFAULT: None

is_stopped

Whether the run is stopped.

TYPE: bool | None DEFAULT: None

description_contains

Partial description of the run.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived runs in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter runs.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Run]

A list of Run objects that match the filter criteria.

stop

stop(run: str | Run) -> Run

Stop a run by setting its stop time to the current time.

PARAMETER DESCRIPTION
run

The Run or run ID to stop.

TYPE: str | Run

unarchive

unarchive(run: str | Run) -> Run

Unarchive a run.

PARAMETER DESCRIPTION
run

The Run or run ID to unarchive.

TYPE: str | Run

update

update(run: str | Run, update: RunUpdate | dict) -> Run

Update a Run.

PARAMETER DESCRIPTION
run

The Run or run ID to update.

TYPE: str | Run

update

Updates to apply to the Run.

TYPE: RunUpdate | dict

RETURNS DESCRIPTION
Run

The updated Run.

RunsAPIAsync

RunsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with runs.

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

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

Initialize the RunsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a run.

create

Create a new run.

find

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

get

Get a Run.

list_

List runs with optional filtering.

stop

Stop a run by setting its stop time to the current time.

unarchive

Unarchive a run.

update

Update a Run.

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

archive async

archive(run: str | Run) -> Run

Archive a run.

PARAMETER DESCRIPTION
run

The Run or run ID to archive.

TYPE: str | Run

create async

create(
    create: RunCreate | dict,
    assets: list[str | Asset] | None = None,
    associate_new_data: bool = False,
) -> Run

Create a new run.

Note on assets: You do not need to provide asset info when creating a run. If you pass a Run to future ingestion configs associated with assets, the association will happen automatically then. However, if you do pass assets and set associate_new_data=True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run. This may be useful if you want to capture a time range for a specific asset or won't know about this Run when ingesting to that asset. If the data has already been ingested, leave associate_new_data=False.

PARAMETER DESCRIPTION
create

The Run definition to create.

TYPE: RunCreate | dict

assets

List of assets to associate with the run. Note: if you are associating new data, you must provide assets/asset names.

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

associate_new_data

If True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Run

The created Run.

find async

find(**kwargs) -> Run | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
Run | None

The Run found or None.

get async

get(
    *,
    run_id: str | None = None,
    client_key: str | None = None,
) -> Run

Get a Run.

PARAMETER DESCRIPTION
run_id

The ID of the run.

TYPE: str | None DEFAULT: None

client_key

The client key of the run.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
Run

The Run.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    run_ids: list[str] | None = None,
    client_keys: list[str] | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    created_by: Any | str | None = None,
    modified_by: Any | str | None = None,
    tags: list[str | Tag] | None = None,
    metadata: list[Any] | None = None,
    assets: list[Asset] | list[str] | None = None,
    asset_tags: list[str | Tag] | None = None,
    duration_less_than: timedelta | None = None,
    duration_greater_than: timedelta | None = None,
    start_time_after: datetime | None = None,
    start_time_before: datetime | None = None,
    stop_time_after: datetime | None = None,
    stop_time_before: datetime | None = None,
    is_stopped: bool | None = None,
    description_contains: str | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Run]

List runs with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the run.

TYPE: str | None DEFAULT: None

names

List of run names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the run.

TYPE: str | None DEFAULT: None

name_regex

Regular expression to filter runs by name.

TYPE: str | Pattern | None DEFAULT: None

run_ids

Filter to runs with any of these IDs.

TYPE: list[str] | None DEFAULT: None

client_keys

Filter to runs with any of these client keys.

TYPE: list[str] | None DEFAULT: None

created_after

Filter runs created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter runs created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter runs modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter runs modified before this datetime.

TYPE: datetime | None DEFAULT: None

created_by

Filter runs created by this User or user ID.

TYPE: Any | str | None DEFAULT: None

modified_by

Filter runs last modified by this User or user ID.

TYPE: Any | str | None DEFAULT: None

tags

Filter runs with any of these Tags IDs.

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

metadata

Filter runs by metadata criteria.

TYPE: list[Any] | None DEFAULT: None

assets

Filter runs associated with any of these Assets or asset IDs.

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

asset_tags

Filter runs associated with any Assets that have these Tag IDs.

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

duration_less_than

Filter runs with duration less than this time.

TYPE: timedelta | None DEFAULT: None

duration_greater_than

Filter runs with duration greater than this time.

TYPE: timedelta | None DEFAULT: None

start_time_after

Filter runs that started after this datetime.

TYPE: datetime | None DEFAULT: None

start_time_before

Filter runs that started before this datetime.

TYPE: datetime | None DEFAULT: None

stop_time_after

Filter runs that stopped after this datetime.

TYPE: datetime | None DEFAULT: None

stop_time_before

Filter runs that stopped before this datetime.

TYPE: datetime | None DEFAULT: None

is_stopped

Whether the run is stopped.

TYPE: bool | None DEFAULT: None

description_contains

Partial description of the run.

TYPE: str | None DEFAULT: None

include_archived

If True, include archived runs in results.

TYPE: bool DEFAULT: False

filter_query

Explicit CEL query to filter runs.

TYPE: str | None DEFAULT: None

order_by

Field and direction to order results by.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Run]

A list of Run objects that match the filter criteria.

stop async

stop(run: str | Run) -> Run

Stop a run by setting its stop time to the current time.

PARAMETER DESCRIPTION
run

The Run or run ID to stop.

TYPE: str | Run

unarchive async

unarchive(run: str | Run) -> Run

Unarchive a run.

PARAMETER DESCRIPTION
run

The Run or run ID to unarchive.

TYPE: str | Run

update async

update(run: str | Run, update: RunUpdate | dict) -> Run

Update a Run.

PARAMETER DESCRIPTION
run

The Run or run ID to update.

TYPE: str | Run

update

Updates to apply to the Run.

TYPE: RunUpdate | dict

RETURNS DESCRIPTION
Run

The updated Run.

TagsAPI

TagsAPI(sift_client: SiftClient)

Sync counterpart to TagsAPIAsync.

High-level API for interacting with tags.

Initialize the TagsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
create

Create a new tag.

find

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

find_or_create

Find tags by name or create them if they don't exist.

list_

List tags with optional filtering.

update

Update a Tag.

create

create(name: str) -> Tag

Create a new tag.

PARAMETER DESCRIPTION
name

The name of the tag.

TYPE: str

RETURNS DESCRIPTION
Tag

The created Tag.

find

find(**kwargs) -> Tag | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Tag | None

The Tag found or None.

find_or_create

find_or_create(names: list[str]) -> list[Tag]

Find tags by name or create them if they don't exist.

PARAMETER DESCRIPTION
names

List of tag names to find or create.

TYPE: list[str]

RETURNS DESCRIPTION
list[Tag]

List of Tags that were found or created.

list_

list_(
    *,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    names: list[str] | None = None,
    tag_ids: list[str] | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Tag]

List tags with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the tag.

TYPE: str | None DEFAULT: None

name_contains

Partial name of the tag.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter tags by name.

TYPE: str | Pattern | None DEFAULT: None

names

List of tag names to filter by.

TYPE: list[str] | None DEFAULT: None

tag_ids

List of tag IDs to filter by.

TYPE: list[str] | None DEFAULT: None

filter_query

Explicit CEL query to filter tags.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved tags.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Tag]

A list of Tags that matches the filter.

update

update(tag: str | Tag, update: TagUpdate | dict) -> Tag

Update a Tag.

PARAMETER DESCRIPTION
tag

The Tag or tag ID to update.

TYPE: str | Tag

update

Updates to apply to the Tag.

TYPE: TagUpdate | dict

RETURNS DESCRIPTION
Tag

The updated Tag.

Note

The tags API doesn't have an update method in the proto, so this would need to be implemented if the API supports it.

TagsAPIAsync

TagsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with tags.

Initialize the TagsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
create

Create a new tag.

find

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

find_or_create

Find tags by name or create them if they don't exist.

list_

List tags with optional filtering.

update

Update a Tag.

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

create async

create(name: str) -> Tag

Create a new tag.

PARAMETER DESCRIPTION
name

The name of the tag.

TYPE: str

RETURNS DESCRIPTION
Tag

The created Tag.

find async

find(**kwargs) -> Tag | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Tag | None

The Tag found or None.

find_or_create async

find_or_create(names: list[str]) -> list[Tag]

Find tags by name or create them if they don't exist.

PARAMETER DESCRIPTION
names

List of tag names to find or create.

TYPE: list[str]

RETURNS DESCRIPTION
list[Tag]

List of Tags that were found or created.

list_ async

list_(
    *,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    names: list[str] | None = None,
    tag_ids: list[str] | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Tag]

List tags with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the tag.

TYPE: str | None DEFAULT: None

name_contains

Partial name of the tag.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter tags by name.

TYPE: str | Pattern | None DEFAULT: None

names

List of tag names to filter by.

TYPE: list[str] | None DEFAULT: None

tag_ids

List of tag IDs to filter by.

TYPE: list[str] | None DEFAULT: None

filter_query

Explicit CEL query to filter tags.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved tags.

TYPE: str | None DEFAULT: None

limit

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

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Tag]

A list of Tags that matches the filter.

update async

update(tag: str | Tag, update: TagUpdate | dict) -> Tag

Update a Tag.

PARAMETER DESCRIPTION
tag

The Tag or tag ID to update.

TYPE: str | Tag

update

Updates to apply to the Tag.

TYPE: TagUpdate | dict

RETURNS DESCRIPTION
Tag

The updated Tag.

Note

The tags API doesn't have an update method in the proto, so this would need to be implemented if the API supports it.

TestResultsAPI

TestResultsAPI(sift_client: SiftClient)

Sync counterpart to TestResultsAPIAsync.

High-level API for interacting with test reports, steps, and measurements.

Initialize the TestResultsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a test report.

create

Create a new test report.

create_measurement

Create a new test measurement.

create_measurements

Create multiple test measurements in a single request.

create_step

Create a new test step.

delete

Delete a test report.

delete_measurement

Delete a test measurement.

delete_step

Delete a test step.

find

Find a single test report matching the given query. Takes the same arguments as list_. If more than one test report is found,

get

Get a TestReport.

get_step

Get a TestStep.

import_

Import a test report from an already-uploaded file.

list_

List test reports with optional filtering.

list_measurements

List test measurements with optional filtering.

list_steps

List test steps with optional filtering.

unarchive

Unarchive a test report.

update

Update a TestReport.

update_measurement

Update a TestMeasurement.

update_step

Update a TestStep.

archive

archive(*, test_report: str | TestReport) -> TestReport

Archive a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to archive.

TYPE: str | TestReport

create

create(test_report: TestReportCreate | dict) -> TestReport

Create a new test report.

PARAMETER DESCRIPTION
test_report

The test report to create (can be TestReport or TestReportCreate).

TYPE: TestReportCreate | dict

RETURNS DESCRIPTION
TestReport

The created TestReport.

create_measurement

create_measurement(
    test_measurement: TestMeasurementCreate | dict,
    update_step: bool = False,
) -> TestMeasurement

Create a new test measurement.

PARAMETER DESCRIPTION
test_measurement

The test measurement to create (can be TestMeasurement or TestMeasurementCreate).

TYPE: TestMeasurementCreate | dict

update_step

Whether to update the step to failed if the measurement is being created is failed.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
TestMeasurement

The created TestMeasurement.

create_measurements

create_measurements(
    test_measurements: list[TestMeasurementCreate],
) -> tuple[int, list[str]]

Create multiple test measurements in a single request.

PARAMETER DESCRIPTION
test_measurements

The test measurements to create.

TYPE: list[TestMeasurementCreate]

RETURNS DESCRIPTION
tuple[int, list[str]]

A tuple of (measurements_created_count, measurement_ids).

create_step

create_step(test_step: TestStepCreate | dict) -> TestStep

Create a new test step.

PARAMETER DESCRIPTION
test_step

The test step to create (can be TestStep or TestStepCreate).

TYPE: TestStepCreate | dict

RETURNS DESCRIPTION
TestStep

The created TestStep.

delete

delete(*, test_report: str | TestReport) -> None

Delete a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to delete.

TYPE: str | TestReport

delete_measurement

delete_measurement(
    *, test_measurement: str | TestMeasurement
) -> None

Delete a test measurement.

PARAMETER DESCRIPTION
test_measurement

The TestMeasurement or measurement ID to delete.

TYPE: str | TestMeasurement

delete_step

delete_step(*, test_step: str | TestStep) -> None

Delete a test step.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to delete.

TYPE: str | TestStep

find

find(**kwargs) -> TestReport | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
TestReport | None

The TestReport found or None.

get

get(*, test_report_id: str) -> TestReport

Get a TestReport.

PARAMETER DESCRIPTION
test_report_id

The ID of the test report.

TYPE: str

RETURNS DESCRIPTION
TestReport

The TestReport.

get_step

get_step(test_step: str | TestStep) -> TestStep

Get a TestStep.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to get.

TYPE: str | TestStep

import_

import_(test_file: str | Path) -> TestReport

Import a test report from an already-uploaded file.

PARAMETER DESCRIPTION
test_file

The path to the test report file to import. We currently only support XML files exported from NI TestStand.

TYPE: str | Path

RETURNS DESCRIPTION
TestReport

The imported TestReport.

list_

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    test_report_ids: list[str] | None = None,
    status: TestStatus | None = None,
    test_system_name: str | None = None,
    test_case: str | None = None,
    serial_numbers: list[str] | None = None,
    part_numbers: list[str] | None = None,
    system_operator: str | None = None,
    created_by: str | None = None,
    modified_by: str | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    metadata: list[Any] | dict[str, Any] | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestReport]

List test reports with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the test report.

TYPE: str | None DEFAULT: None

names

List of test report names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test report.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test reports by name.

TYPE: str | Pattern | None DEFAULT: None

test_report_ids

Test report IDs to filter by.

TYPE: list[str] | None DEFAULT: None

status

Status to filter by (TestStatus enum).

TYPE: TestStatus | None DEFAULT: None

test_system_name

Test system name to filter by.

TYPE: str | None DEFAULT: None

test_case

Test case to filter by.

TYPE: str | None DEFAULT: None

serial_numbers

Serial numbers to filter by.

TYPE: list[str] | None DEFAULT: None

part_numbers

Part numbers to filter by.

TYPE: list[str] | None DEFAULT: None

system_operator

System operator to filter by.

TYPE: str | None DEFAULT: None

created_by

User ID who created the test report.

TYPE: str | None DEFAULT: None

modified_by

User ID who last modified the test report.

TYPE: str | None DEFAULT: None

created_after

Filter test reports created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter test reports created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter test reports modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter test reports modified before this datetime.

TYPE: datetime | None DEFAULT: None

metadata

Filter test reports by metadata criteria.

TYPE: list[Any] | dict[str, Any] | None DEFAULT: None

include_archived

Whether to include only archived or non-archived reports.

TYPE: bool DEFAULT: False

filter_query

Custom filter to apply to the test reports.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test reports. If used, this will override the other filters.

TYPE: str | None DEFAULT: None

limit

How many test reports to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestReport]

A list of TestReports that matches the filter.

list_measurements

list_measurements(
    *,
    measurements: list[str]
    | list[TestMeasurement]
    | None = None,
    test_steps: list[str] | list[TestStep] | None = None,
    test_reports: list[str]
    | list[TestReport]
    | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    measurement_type: TestMeasurementType | None = None,
    passed: bool | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestMeasurement]

List test measurements with optional filtering.

PARAMETER DESCRIPTION
measurements

Measurements to filter by.

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

test_steps

Test steps to filter by.

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

test_reports

Test reports to filter by.

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

name

Exact name of the test measurement.

TYPE: str | None DEFAULT: None

names

List of test measurement names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test measurement.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test measurements by name.

TYPE: str | Pattern | None DEFAULT: None

measurement_type

Measurement type to filter by (TestMeasurementType enum).

TYPE: TestMeasurementType | None DEFAULT: None

passed

Whether the measurement passed.

TYPE: bool | None DEFAULT: None

filter_query

Explicit CEL query to filter test measurements.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test measurements.

TYPE: str | None DEFAULT: None

limit

How many test measurements to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestMeasurement]

A list of TestMeasurements that matches the filter.

list_steps

list_steps(
    *,
    test_steps: list[str] | list[TestStep] | None = None,
    test_reports: list[str]
    | list[TestReport]
    | None = None,
    parent_steps: list[str] | list[TestStep] | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    status: TestStatus | None = None,
    step_type: TestStepType | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestStep]

List test steps with optional filtering.

PARAMETER DESCRIPTION
test_steps

Test steps to filter by.

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

test_reports

Test reports to filter by.

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

parent_steps

Parent steps to filter by.

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

name

Exact name of the test step.

TYPE: str | None DEFAULT: None

names

List of test step names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test step.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test steps by name.

TYPE: str | Pattern | None DEFAULT: None

status

Status to filter by (TestStatus enum).

TYPE: TestStatus | None DEFAULT: None

step_type

Step type to filter by (TestStepType enum).

TYPE: TestStepType | None DEFAULT: None

filter_query

Explicit CEL query to filter test steps.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test steps.

TYPE: str | None DEFAULT: None

limit

How many test steps to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestStep]

A list of TestSteps that matches the filter.

unarchive

unarchive(*, test_report: str | TestReport) -> TestReport

Unarchive a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to unarchive.

TYPE: str | TestReport

update

update(
    test_report: str | TestReport,
    update: TestReportUpdate | dict,
) -> TestReport

Update a TestReport.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to update.

TYPE: str | TestReport

update

Updates to apply to the TestReport.

TYPE: TestReportUpdate | dict

RETURNS DESCRIPTION
TestReport

The updated TestReport.

update_measurement

update_measurement(
    test_measurement: TestMeasurement,
    update: TestMeasurementUpdate | dict,
    update_step: bool = False,
) -> TestMeasurement

Update a TestMeasurement.

PARAMETER DESCRIPTION
test_measurement

The TestMeasurement or measurement ID to update.

TYPE: TestMeasurement

update

Updates to apply to the TestMeasurement.

TYPE: TestMeasurementUpdate | dict

update_step

Whether to update the step to failed if the measurement is being updated to failed.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
TestMeasurement

The updated TestMeasurement.

update_step

update_step(
    test_step: str | TestStep, update: TestStepUpdate | dict
) -> TestStep

Update a TestStep.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to update.

TYPE: str | TestStep

update

Updates to apply to the TestStep.

TYPE: TestStepUpdate | dict

RETURNS DESCRIPTION
TestStep

The updated TestStep.

TestResultsAPIAsync

TestResultsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with test reports, steps, and measurements.

Initialize the TestResultsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a test report.

create

Create a new test report.

create_measurement

Create a new test measurement.

create_measurements

Create multiple test measurements in a single request.

create_step

Create a new test step.

delete

Delete a test report.

delete_measurement

Delete a test measurement.

delete_step

Delete a test step.

find

Find a single test report matching the given query. Takes the same arguments as list_. If more than one test report is found,

get

Get a TestReport.

get_step

Get a TestStep.

import_

Import a test report from an already-uploaded file.

list_

List test reports with optional filtering.

list_measurements

List test measurements with optional filtering.

list_steps

List test steps with optional filtering.

unarchive

Unarchive a test report.

update

Update a TestReport.

update_measurement

Update a TestMeasurement.

update_step

Update a TestStep.

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

archive async

archive(*, test_report: str | TestReport) -> TestReport

Archive a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to archive.

TYPE: str | TestReport

create async

create(test_report: TestReportCreate | dict) -> TestReport

Create a new test report.

PARAMETER DESCRIPTION
test_report

The test report to create (can be TestReport or TestReportCreate).

TYPE: TestReportCreate | dict

RETURNS DESCRIPTION
TestReport

The created TestReport.

create_measurement async

create_measurement(
    test_measurement: TestMeasurementCreate | dict,
    update_step: bool = False,
) -> TestMeasurement

Create a new test measurement.

PARAMETER DESCRIPTION
test_measurement

The test measurement to create (can be TestMeasurement or TestMeasurementCreate).

TYPE: TestMeasurementCreate | dict

update_step

Whether to update the step to failed if the measurement is being created is failed.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
TestMeasurement

The created TestMeasurement.

create_measurements async

create_measurements(
    test_measurements: list[TestMeasurementCreate],
) -> tuple[int, list[str]]

Create multiple test measurements in a single request.

PARAMETER DESCRIPTION
test_measurements

The test measurements to create.

TYPE: list[TestMeasurementCreate]

RETURNS DESCRIPTION
tuple[int, list[str]]

A tuple of (measurements_created_count, measurement_ids).

create_step async

create_step(test_step: TestStepCreate | dict) -> TestStep

Create a new test step.

PARAMETER DESCRIPTION
test_step

The test step to create (can be TestStep or TestStepCreate).

TYPE: TestStepCreate | dict

RETURNS DESCRIPTION
TestStep

The created TestStep.

delete async

delete(*, test_report: str | TestReport) -> None

Delete a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to delete.

TYPE: str | TestReport

delete_measurement async

delete_measurement(
    *, test_measurement: str | TestMeasurement
) -> None

Delete a test measurement.

PARAMETER DESCRIPTION
test_measurement

The TestMeasurement or measurement ID to delete.

TYPE: str | TestMeasurement

delete_step async

delete_step(*, test_step: str | TestStep) -> None

Delete a test step.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to delete.

TYPE: str | TestStep

find async

find(**kwargs) -> TestReport | None

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

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list_.

DEFAULT: {}

RETURNS DESCRIPTION
TestReport | None

The TestReport found or None.

get async

get(*, test_report_id: str) -> TestReport

Get a TestReport.

PARAMETER DESCRIPTION
test_report_id

The ID of the test report.

TYPE: str

RETURNS DESCRIPTION
TestReport

The TestReport.

get_step async

get_step(test_step: str | TestStep) -> TestStep

Get a TestStep.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to get.

TYPE: str | TestStep

import_ async

import_(test_file: str | Path) -> TestReport

Import a test report from an already-uploaded file.

PARAMETER DESCRIPTION
test_file

The path to the test report file to import. We currently only support XML files exported from NI TestStand.

TYPE: str | Path

RETURNS DESCRIPTION
TestReport

The imported TestReport.

list_ async

list_(
    *,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    test_report_ids: list[str] | None = None,
    status: TestStatus | None = None,
    test_system_name: str | None = None,
    test_case: str | None = None,
    serial_numbers: list[str] | None = None,
    part_numbers: list[str] | None = None,
    system_operator: str | None = None,
    created_by: str | None = None,
    modified_by: str | None = None,
    created_after: datetime | None = None,
    created_before: datetime | None = None,
    modified_after: datetime | None = None,
    modified_before: datetime | None = None,
    metadata: list[Any] | dict[str, Any] | None = None,
    include_archived: bool = False,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestReport]

List test reports with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the test report.

TYPE: str | None DEFAULT: None

names

List of test report names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test report.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test reports by name.

TYPE: str | Pattern | None DEFAULT: None

test_report_ids

Test report IDs to filter by.

TYPE: list[str] | None DEFAULT: None

status

Status to filter by (TestStatus enum).

TYPE: TestStatus | None DEFAULT: None

test_system_name

Test system name to filter by.

TYPE: str | None DEFAULT: None

test_case

Test case to filter by.

TYPE: str | None DEFAULT: None

serial_numbers

Serial numbers to filter by.

TYPE: list[str] | None DEFAULT: None

part_numbers

Part numbers to filter by.

TYPE: list[str] | None DEFAULT: None

system_operator

System operator to filter by.

TYPE: str | None DEFAULT: None

created_by

User ID who created the test report.

TYPE: str | None DEFAULT: None

modified_by

User ID who last modified the test report.

TYPE: str | None DEFAULT: None

created_after

Filter test reports created after this datetime.

TYPE: datetime | None DEFAULT: None

created_before

Filter test reports created before this datetime.

TYPE: datetime | None DEFAULT: None

modified_after

Filter test reports modified after this datetime.

TYPE: datetime | None DEFAULT: None

modified_before

Filter test reports modified before this datetime.

TYPE: datetime | None DEFAULT: None

metadata

Filter test reports by metadata criteria.

TYPE: list[Any] | dict[str, Any] | None DEFAULT: None

include_archived

Whether to include only archived or non-archived reports.

TYPE: bool DEFAULT: False

filter_query

Custom filter to apply to the test reports.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test reports. If used, this will override the other filters.

TYPE: str | None DEFAULT: None

limit

How many test reports to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestReport]

A list of TestReports that matches the filter.

list_measurements async

list_measurements(
    *,
    measurements: list[str]
    | list[TestMeasurement]
    | None = None,
    test_steps: list[str] | list[TestStep] | None = None,
    test_reports: list[str]
    | list[TestReport]
    | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    measurement_type: TestMeasurementType | None = None,
    passed: bool | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestMeasurement]

List test measurements with optional filtering.

PARAMETER DESCRIPTION
measurements

Measurements to filter by.

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

test_steps

Test steps to filter by.

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

test_reports

Test reports to filter by.

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

name

Exact name of the test measurement.

TYPE: str | None DEFAULT: None

names

List of test measurement names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test measurement.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test measurements by name.

TYPE: str | Pattern | None DEFAULT: None

measurement_type

Measurement type to filter by (TestMeasurementType enum).

TYPE: TestMeasurementType | None DEFAULT: None

passed

Whether the measurement passed.

TYPE: bool | None DEFAULT: None

filter_query

Explicit CEL query to filter test measurements.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test measurements.

TYPE: str | None DEFAULT: None

limit

How many test measurements to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestMeasurement]

A list of TestMeasurements that matches the filter.

list_steps async

list_steps(
    *,
    test_steps: list[str] | list[TestStep] | None = None,
    test_reports: list[str]
    | list[TestReport]
    | None = None,
    parent_steps: list[str] | list[TestStep] | None = None,
    name: str | None = None,
    names: list[str] | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    status: TestStatus | None = None,
    step_type: TestStepType | None = None,
    filter_query: str | None = None,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[TestStep]

List test steps with optional filtering.

PARAMETER DESCRIPTION
test_steps

Test steps to filter by.

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

test_reports

Test reports to filter by.

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

parent_steps

Parent steps to filter by.

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

name

Exact name of the test step.

TYPE: str | None DEFAULT: None

names

List of test step names to filter by.

TYPE: list[str] | None DEFAULT: None

name_contains

Partial name of the test step.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter test steps by name.

TYPE: str | Pattern | None DEFAULT: None

status

Status to filter by (TestStatus enum).

TYPE: TestStatus | None DEFAULT: None

step_type

Step type to filter by (TestStepType enum).

TYPE: TestStepType | None DEFAULT: None

filter_query

Explicit CEL query to filter test steps.

TYPE: str | None DEFAULT: None

order_by

How to order the retrieved test steps.

TYPE: str | None DEFAULT: None

limit

How many test steps to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[TestStep]

A list of TestSteps that matches the filter.

unarchive async

unarchive(*, test_report: str | TestReport) -> TestReport

Unarchive a test report.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to unarchive.

TYPE: str | TestReport

update async

update(
    test_report: str | TestReport,
    update: TestReportUpdate | dict,
) -> TestReport

Update a TestReport.

PARAMETER DESCRIPTION
test_report

The TestReport or test report ID to update.

TYPE: str | TestReport

update

Updates to apply to the TestReport.

TYPE: TestReportUpdate | dict

RETURNS DESCRIPTION
TestReport

The updated TestReport.

update_measurement async

update_measurement(
    test_measurement: TestMeasurement,
    update: TestMeasurementUpdate | dict,
    update_step: bool = False,
) -> TestMeasurement

Update a TestMeasurement.

PARAMETER DESCRIPTION
test_measurement

The TestMeasurement or measurement ID to update.

TYPE: TestMeasurement

update

Updates to apply to the TestMeasurement.

TYPE: TestMeasurementUpdate | dict

update_step

Whether to update the step to failed if the measurement is being updated to failed.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
TestMeasurement

The updated TestMeasurement.

update_step async

update_step(
    test_step: str | TestStep, update: TestStepUpdate | dict
) -> TestStep

Update a TestStep.

PARAMETER DESCRIPTION
test_step

The TestStep or test step ID to update.

TYPE: str | TestStep

update

Updates to apply to the TestStep.

TYPE: TestStepUpdate | dict

RETURNS DESCRIPTION
TestStep

The updated TestStep.