sift_client.client
¶
| CLASS | DESCRIPTION |
|---|---|
SiftClient |
SiftClient is a high-level client for interacting with Sift's APIs. |
SiftClient
¶
SiftClient(
api_key: str | None = None,
grpc_url: str | None = None,
rest_url: str | None = None,
connection_config: SiftConnectionConfig | None = None,
app_url: str | None = None,
)
Bases: WithGrpcClient, WithRestClient
SiftClient is a high-level client for interacting with Sift's APIs.
It provides both synchronous and asynchronous interfaces, strong type checking, and a Pythonic API design.
Initialize the SiftClient with specific connection parameters or a connection_config.
| PARAMETER | DESCRIPTION |
|---|---|
api_key
|
The Sift API key for authentication.
TYPE:
|
grpc_url
|
The Sift gRPC API URL.
TYPE:
|
rest_url
|
The Sift REST API URL.
TYPE:
|
connection_config
|
A SiftConnectionConfig object to configure the connection behavior of the SiftClient.
TYPE:
|
app_url
|
The Sift web-app origin (e.g.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_asyncio_loop |
Gets the default asyncio loop used by the gRPC client. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
app_url |
The Sift web-app origin for this client, or None if it can't be determined.
TYPE:
|
assets |
Instance of the Assets API for making synchronous requests.
TYPE:
|
async_ |
Accessor for the asynchronous APIs. All asynchronous APIs are available as attributes on this accessor.
TYPE:
|
calculated_channels |
Instance of the Calculated Channels API for making synchronous requests.
TYPE:
|
channels |
Instance of the Channels API for making synchronous requests.
TYPE:
|
data_export |
Instance of the Data Export API for making synchronous requests.
TYPE:
|
data_import |
Instance of the Data Import API for making synchronous requests.
TYPE:
|
file_attachments |
Instance of the File Attachments API for making synchronous requests.
TYPE:
|
grpc_client |
The gRPC client used by the SiftClient for making gRPC API calls.
TYPE:
|
ingestion |
Instance of the Ingestion API for making synchronous requests.
TYPE:
|
jobs |
Instance of the Jobs API for making synchronous requests.
TYPE:
|
ping |
Instance of the Ping API for making synchronous requests.
TYPE:
|
reports |
Instance of the Reports API for making synchronous requests.
TYPE:
|
rest_client |
The REST client used by the SiftClient for making REST API calls.
TYPE:
|
rules |
Instance of the Rules API for making synchronous requests.
TYPE:
|
runs |
Instance of the Runs API for making synchronous requests.
TYPE:
|
tags |
Instance of the Tags API for making synchronous requests.
TYPE:
|
test_results |
Instance of the Test Results API for making synchronous requests.
TYPE:
|
app_url
property
¶
The Sift web-app origin for this client, or None if it can't be determined.
Uses the explicit override passed at construction when set, otherwise
derives the origin from the REST host for known Sift deployments (e.g.
https://api.siftstack.com -> https://app.siftstack.com). Returns
None for unrecognized hosts with no override.
TODO: Add a WithAppPage mixin on BaseType so resources (TestReport,¶
Run, ...) can expose their own web-app link from _client.app_url plus¶
a per-type path, instead of callers assembling paths by hand.¶
assets
instance-attribute
¶
Instance of the Assets API for making synchronous requests.
async_
instance-attribute
¶
async_: AsyncAPIs = AsyncAPIs(
ping=PingAPIAsync(self),
assets=AssetsAPIAsync(self),
calculated_channels=CalculatedChannelsAPIAsync(self),
channels=ChannelsAPIAsync(self),
file_attachments=FileAttachmentsAPIAsync(self),
ingestion=IngestionAPIAsync(self),
jobs=JobsAPIAsync(self),
reports=ReportsAPIAsync(self),
rules=RulesAPIAsync(self),
runs=RunsAPIAsync(self),
tags=TagsAPIAsync(self),
test_results=TestResultsAPIAsync(self),
data_export=DataExportAPIAsync(self),
data_import=DataImportAPIAsync(self),
)
Accessor for the asynchronous APIs. All asynchronous APIs are available as attributes on this accessor.
calculated_channels
instance-attribute
¶
calculated_channels: CalculatedChannelsAPI = (
CalculatedChannelsAPI(self)
)
Instance of the Calculated Channels API for making synchronous requests.
channels
instance-attribute
¶
channels: ChannelsAPI = ChannelsAPI(self)
Instance of the Channels API for making synchronous requests.
data_export
instance-attribute
¶
data_export: DataExportAPI = DataExportAPI(self)
Instance of the Data Export API for making synchronous requests.
data_import
instance-attribute
¶
data_import: DataImportAPI = DataImportAPI(self)
Instance of the Data Import API for making synchronous requests.
file_attachments
instance-attribute
¶
file_attachments: FileAttachmentsAPI = FileAttachmentsAPI(
self
)
Instance of the File Attachments API for making synchronous requests.
grpc_client
property
¶
grpc_client: GrpcClient
The gRPC client used by the SiftClient for making gRPC API calls.
ingestion
instance-attribute
¶
ingestion: IngestionAPIAsync
Instance of the Ingestion API for making synchronous requests.
jobs
instance-attribute
¶
Instance of the Jobs API for making synchronous requests.
ping
instance-attribute
¶
Instance of the Ping API for making synchronous requests.
reports
instance-attribute
¶
reports: ReportsAPI = ReportsAPI(self)
Instance of the Reports API for making synchronous requests.
rest_client
property
¶
rest_client: RestClient
The REST client used by the SiftClient for making REST API calls.
rules
instance-attribute
¶
Instance of the Rules API for making synchronous requests.
runs
instance-attribute
¶
Instance of the Runs API for making synchronous requests.
tags
instance-attribute
¶
Instance of the Tags API for making synchronous requests.
test_results
instance-attribute
¶
test_results: TestResultsAPI = TestResultsAPI(self)
Instance of the Test Results API for making synchronous requests.
get_asyncio_loop
¶
Gets the default asyncio loop used by the gRPC client.
| RETURNS | DESCRIPTION |
|---|---|
AbstractEventLoop
|
The default asyncio loop. |