sift_client.resources.exports
¶
| CLASS | DESCRIPTION |
|---|---|
DataExportAPIAsync |
High-level API for exporting data from Sift. |
DataExportAPIAsync
¶
DataExportAPIAsync(sift_client: SiftClient)
Bases: ResourceBase
High-level API for exporting data from Sift.
Initialize the DataExportAPI.
| PARAMETER | DESCRIPTION |
|---|---|
sift_client
|
The Sift client to use.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
export |
Export data from Sift. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
client |
TYPE:
|
grpc_client |
TYPE:
|
rest_client |
TYPE:
|
export
async
¶
export(
*,
output_format: ExportOutputFormat,
runs: list[str | Run] | None = None,
assets: list[str | Asset] | None = None,
start_time: datetime | None = None,
stop_time: datetime | None = None,
channels: list[str | Channel] | None = None,
calculated_channels: list[
CalculatedChannel | CalculatedChannelCreate | dict
]
| None = None,
simplify_channel_names: bool = False,
combine_runs: bool = False,
split_export_by_asset: bool = False,
split_export_by_run: bool = False,
) -> Job
Export data from Sift.
Initiates an export on the server and returns a Job handle. Use
job.wait_and_download() to poll for completion and download the files.
There are three ways to scope the export, determined by which arguments are provided:
-
By runs — provide
runs. Thestart_time/stop_timeare optional (if omitted, the full time range of each run is used). If nochannelsorcalculated_channelsare provided, all channels from the runs' assets are included. -
By assets — provide
assets. Bothstart_timeandstop_timeare required. If nochannelsorcalculated_channelsare provided, all channels from the assets are included. -
By time range only — provide
start_timeandstop_timewithoutrunsorassets. At least one ofchannelsorcalculated_channelsmust be provided to scope the data.
You cannot provide both runs and assets at the same time.
| PARAMETER | DESCRIPTION |
|---|---|
output_format
|
The file format for the export (CSV or Sun/WinPlot).
TYPE:
|
runs
|
One or more Run objects or run IDs to export data from.
TYPE:
|
assets
|
One or more Asset objects or asset IDs to export data from.
TYPE:
|
start_time
|
Start of the time range to export. Required when using assets or time-range-only mode; optional when using runs.
TYPE:
|
stop_time
|
End of the time range to export. Required when using assets or time-range-only mode; optional when using runs.
TYPE:
|
channels
|
Channel objects or channel IDs to include. If omitted and
runs or assets are provided, all channels are exported. Required
(along with
TYPE:
|
calculated_channels
|
Calculated channels to include in the export. Accepts existing CalculatedChannel objects, CalculatedChannelCreate definitions, or dictionaries that will be converted to CalculatedChannelCreate via model_validate.
TYPE:
|
simplify_channel_names
|
Remove text preceding last period in channel names, only if the resulting simplified name is unique.
TYPE:
|
combine_runs
|
Identical channels within the same asset across multiple runs will be combined into a single column.
TYPE:
|
split_export_by_asset
|
Split each asset into a separate file, with asset name removed from channel name display.
TYPE:
|
split_export_by_run
|
Split each run into a separate file, with run name removed from channel name display.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Job
|
A Job handle for the pending export. |