sift_client.sift_types
¶
MODULE | DESCRIPTION |
---|---|
asset |
|
calculated_channel |
|
channel |
|
ingestion |
|
rule |
|
run |
|
CLASS | DESCRIPTION |
---|---|
Asset |
Model of the Sift Asset. |
AssetUpdate |
Model of the Asset Fields that can be updated. |
CalculatedChannel |
Model of the Sift Calculated Channel. |
CalculatedChannelUpdate |
Model of the Calculated Channel Fields that can be updated. |
Channel |
Model representing a Sift Channel. |
ChannelBitFieldElement |
Bit field element model. |
ChannelDataType |
Enum for channel data types (mimics protobuf values, but as int for now). |
ChannelReference |
Channel reference for calculated channel or rule. |
IngestionConfig |
Model of the Sift Ingestion Config. |
Rule |
Model of the Sift Rule. |
RuleAction |
Model of a Rule Action. |
RuleActionType |
Enum for rule action kinds. |
RuleAnnotationType |
Enum for rule annotation types. |
RuleUpdate |
Model of the Rule fields that can be updated. |
RuleVersion |
Model of a Rule Version. |
Run |
Run model representing a data collection run. |
RunUpdate |
Update model for Run. |
__all__
module-attribute
¶
__all__ = [
"Asset",
"AssetUpdate",
"CalculatedChannel",
"CalculatedChannelUpdate",
"Channel",
"ChannelBitFieldElement",
"ChannelDataType",
"ChannelReference",
"IngestionConfig",
"Rule",
"RuleAction",
"RuleActionType",
"RuleAnnotationType",
"RuleUpdate",
"RuleVersion",
"Run",
"RunUpdate",
]
Asset
¶
Bases: BaseType[Asset, 'Asset']
Model of the Sift Asset.
METHOD | DESCRIPTION |
---|---|
archive |
Archive the asset. |
channels |
Get the channels for this asset. |
update |
Update the Asset. |
ATTRIBUTE | DESCRIPTION |
---|---|
annotations |
Get the annotations for this asset.
|
archived_date |
TYPE:
|
created_by |
Get the user that created this asset.
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
is_archived |
Whether the asset is archived.
|
metadata |
|
modified_by |
Get the user that modified this asset.
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
name |
TYPE:
|
organization_id |
TYPE:
|
rules |
Get the rules that apply to this asset.
|
runs |
Get the runs associated with this asset. |
tags |
|
archive
¶
Archive the asset.
PARAMETER | DESCRIPTION |
---|---|
archive_runs
|
If True, archive all Runs associated with the Asset.
TYPE:
|
channels
¶
Get the channels for this asset.
update
¶
update(update: AssetUpdate | dict) -> Asset
Update the Asset.
PARAMETER | DESCRIPTION |
---|---|
update
|
Either an AssetUpdate instance or a dictionary of key-value pairs to update.
TYPE:
|
AssetUpdate
¶
AssetUpdate(**data: Any)
Bases: ModelUpdate[Asset]
Model of the Asset Fields that can be updated.
ATTRIBUTE | DESCRIPTION |
---|---|
archived_date |
|
metadata |
|
tags |
|
CalculatedChannel
¶
Bases: BaseType[CalculatedChannel, 'CalculatedChannel']
Model of the Sift Calculated Channel.
METHOD | DESCRIPTION |
---|---|
archive |
Archive the calculated channel. |
update |
Update the Calculated Channel. |
ATTRIBUTE | DESCRIPTION |
---|---|
all_assets |
TYPE:
|
archived_date |
TYPE:
|
asset_ids |
|
change_message |
TYPE:
|
channel_references |
TYPE:
|
client_key |
TYPE:
|
created_by |
Get the user that created this calculated channel.
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
description |
TYPE:
|
expression |
TYPE:
|
is_archived |
Whether the calculated channel is archived.
|
modified_by |
Get the user that modified this calculated channel.
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
name |
TYPE:
|
organization_id |
TYPE:
|
tag_ids |
|
units |
TYPE:
|
user_notes |
TYPE:
|
version |
TYPE:
|
version_id |
TYPE:
|
update
¶
update(
update: CalculatedChannelUpdate | dict,
user_notes: str | None = None,
) -> CalculatedChannel
Update the Calculated Channel.
PARAMETER | DESCRIPTION |
---|---|
update
|
The update to apply to the calculated channel. See CalculatedChannelUpdate for more updatable fields.
TYPE:
|
user_notes
|
The user notes to apply to the calculated channel.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
CalculatedChannel
|
The updated calculated channel. |
CalculatedChannelUpdate
¶
CalculatedChannelUpdate(**data: Any)
Bases: ModelUpdate[CalculatedChannel]
Model of the Calculated Channel Fields that can be updated.
Initialize a CalculatedChannelUpdate instance.
PARAMETER | DESCRIPTION |
---|---|
**data
|
Keyword arguments for the update fields.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If only one of expression or expression_channel_references is provided. Both must be provided together or neither should be provided. |
ATTRIBUTE | DESCRIPTION |
---|---|
archived_date |
TYPE:
|
description |
TYPE:
|
expression |
TYPE:
|
expression_channel_references |
TYPE:
|
name |
TYPE:
|
tag_ids |
|
units |
TYPE:
|
expression_channel_references
class-attribute
instance-attribute
¶
expression_channel_references: (
list[ChannelReference] | None
) = None
Channel
¶
Bases: BaseType[Channel, 'Channel']
Model representing a Sift Channel.
METHOD | DESCRIPTION |
---|---|
data |
Retrieve channel data for this channel during the specified run. |
ATTRIBUTE | DESCRIPTION |
---|---|
asset |
Get the asset that this channel belongs to.
TYPE:
|
asset_id |
TYPE:
|
bit_field_elements |
TYPE:
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
data_type |
TYPE:
|
description |
TYPE:
|
enum_types |
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
name |
TYPE:
|
runs |
Get all runs associated with this channel's asset. |
unit |
TYPE:
|
bit_field_elements
class-attribute
instance-attribute
¶
bit_field_elements: list[ChannelBitFieldElement] = Field(
default_factory=list
)
enum_types
class-attribute
instance-attribute
¶
data
¶
data(
*,
run_id: str | None = None,
start_time: datetime | None = None,
end_time: datetime | None = None,
limit: int | None = None,
as_arrow: bool = False,
)
Retrieve channel data for this channel during the specified run.
PARAMETER | DESCRIPTION |
---|---|
run_id
|
The run ID to get data for.
TYPE:
|
start_time
|
The start time to get data for.
TYPE:
|
end_time
|
The end time to get data for.
TYPE:
|
limit
|
The maximum number of data points to return.
TYPE:
|
as_arrow
|
Whether to return the data as an Arrow table.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
A dict of channel name to pandas DataFrame or Arrow Table object. |
ChannelBitFieldElement
¶
ChannelDataType
¶
Bases: Enum
Enum for channel data types (mimics protobuf values, but as int for now).
METHOD | DESCRIPTION |
---|---|
__str__ |
|
from_api_format |
Convert API format string to ChannelDataType. |
from_str |
Convert string representation to ChannelDataType. |
hash_str |
Get the hash string for this channel data type. |
proto_data_class |
Return the appropriate protobuf class for the given channel data type. |
ATTRIBUTE | DESCRIPTION |
---|---|
BIT_FIELD |
|
BOOL |
|
BYTES |
|
DOUBLE |
|
ENUM |
|
FLOAT |
|
INT_32 |
|
INT_64 |
|
STRING |
|
UINT_32 |
|
UINT_64 |
|
from_api_format
staticmethod
¶
from_api_format(val: str) -> ChannelDataType | None
Convert API format string to ChannelDataType.
PARAMETER | DESCRIPTION |
---|---|
val
|
API format string representation of ChannelDataType.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ChannelDataType | None
|
ChannelDataType if conversion is successful, None otherwise. |
from_str
staticmethod
¶
from_str(raw: str) -> ChannelDataType | None
Convert string representation to ChannelDataType.
PARAMETER | DESCRIPTION |
---|---|
raw
|
String representation of ChannelDataType.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ChannelDataType | None
|
ChannelDataType if conversion is successful, None otherwise. |
RAISES | DESCRIPTION |
---|---|
Exception
|
If the string format is recognized but cannot be converted. |
hash_str
¶
Get the hash string for this channel data type.
proto_data_class
staticmethod
¶
proto_data_class(data_type: ChannelDataType)
Return the appropriate protobuf class for the given channel data type.
PARAMETER | DESCRIPTION |
---|---|
data_type
|
The channel data type.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
The protobuf class corresponding to the data type. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the data type is not recognized. |
ChannelReference
¶
Bases: BaseModel
Channel reference for calculated channel or rule.
ATTRIBUTE | DESCRIPTION |
---|---|
channel_identifier |
TYPE:
|
channel_reference |
TYPE:
|
IngestionConfig
¶
Rule
¶
Bases: BaseType[Rule, 'Rule']
Model of the Sift Rule.
METHOD | DESCRIPTION |
---|---|
archive |
Archive the rule. |
update |
Update the Rule. |
ATTRIBUTE | DESCRIPTION |
---|---|
action |
TYPE:
|
archived_date |
TYPE:
|
asset_ids |
|
asset_tag_ids |
|
assets |
Get the assets that this rule applies to. |
channel_references |
TYPE:
|
client_key |
TYPE:
|
contextual_channels |
|
created_by |
Get the user that created this rule.
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
description |
TYPE:
|
expression |
TYPE:
|
is_archived |
Whether the rule is archived.
TYPE:
|
is_enabled |
TYPE:
|
is_external |
TYPE:
|
modified_by |
Get the user that modified this rule.
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
name |
TYPE:
|
organization |
Get the organization that this rule belongs to.
|
organization_id |
TYPE:
|
rule_version |
TYPE:
|
tags |
Get the tags that this rule applies to.
|
channel_references
class-attribute
instance-attribute
¶
channel_references: list[ChannelReference] | None = None
contextual_channels
class-attribute
instance-attribute
¶
update
¶
update(
update: RuleUpdate | dict,
version_notes: str | None = None,
) -> Rule
Update the Rule.
PARAMETER | DESCRIPTION |
---|---|
update
|
Either a RuleUpdate instance or a dictionary of key-value pairs to update.
TYPE:
|
version_notes
|
Notes associated with the change.
TYPE:
|
RuleAction
¶
Bases: BaseType[RuleAction, 'RuleAction']
Model of a Rule Action.
METHOD | DESCRIPTION |
---|---|
annotation |
Create an annotation action. |
ATTRIBUTE | DESCRIPTION |
---|---|
action_type |
TYPE:
|
annotation_type |
TYPE:
|
condition_id |
TYPE:
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
default_assignee_user_id |
TYPE:
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
tags |
|
version_id |
TYPE:
|
annotation_type
class-attribute
instance-attribute
¶
annotation_type: RuleAnnotationType | None = None
default_assignee_user_id
class-attribute
instance-attribute
¶
default_assignee_user_id: str | None = None
annotation
classmethod
¶
annotation(
annotation_type: RuleAnnotationType,
tags: list[str],
default_assignee_user_id: str | None = None,
) -> RuleAction
Create an annotation action.
PARAMETER | DESCRIPTION |
---|---|
annotation_type
|
Type of annotation to create.
TYPE:
|
default_assignee_user_id
|
User ID to assign the annotation to.
TYPE:
|
tags
|
List of tag IDs to add to the annotation. |
RuleActionType
¶
Bases: Enum
Enum for rule action kinds.
METHOD | DESCRIPTION |
---|---|
from_str |
Convert string representation to RuleActionType. |
ATTRIBUTE | DESCRIPTION |
---|---|
ANNOTATION |
|
UNSPECIFIED |
|
WEBHOOK |
|
from_str
classmethod
¶
from_str(val: str) -> RuleActionType | None
Convert string representation to RuleActionType.
PARAMETER | DESCRIPTION |
---|---|
val
|
String representation of RuleActionType.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RuleActionType | None
|
RuleActionType if conversion is successful, None otherwise. |
RuleAnnotationType
¶
Bases: Enum
Enum for rule annotation types.
METHOD | DESCRIPTION |
---|---|
from_str |
Convert string representation to RuleAnnotationType. |
ATTRIBUTE | DESCRIPTION |
---|---|
DATA_REVIEW |
|
PHASE |
|
UNSPECIFIED |
|
from_str
classmethod
¶
from_str(val: str) -> RuleAnnotationType | None
Convert string representation to RuleAnnotationType.
PARAMETER | DESCRIPTION |
---|---|
val
|
String representation of RuleAnnotationType.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RuleAnnotationType | None
|
RuleAnnotationType if conversion is successful, None otherwise. |
RuleUpdate
¶
RuleUpdate(**data: Any)
Bases: ModelUpdate[Rule]
Model of the Rule fields that can be updated.
Note
- asset_ids applies this rule to those assets.
- asset_tag_ids applies this rule to assets with those tags.
ATTRIBUTE | DESCRIPTION |
---|---|
action |
TYPE:
|
asset_ids |
|
asset_tag_ids |
|
channel_references |
TYPE:
|
contextual_channels |
|
description |
TYPE:
|
expression |
TYPE:
|
name |
TYPE:
|
channel_references
class-attribute
instance-attribute
¶
channel_references: list[ChannelReference] | None = None
contextual_channels
class-attribute
instance-attribute
¶
RuleVersion
¶
Bases: BaseType[RuleVersion, 'RuleVersion']
Model of a Rule Version.
ATTRIBUTE | DESCRIPTION |
---|---|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
deleted_date |
TYPE:
|
generated_change_message |
TYPE:
|
rule_id |
TYPE:
|
rule_version_id |
TYPE:
|
version |
TYPE:
|
version_notes |
TYPE:
|
Run
¶
Bases: BaseType[Run, 'Run']
Run model representing a data collection run.
ATTRIBUTE | DESCRIPTION |
---|---|
archived_date |
TYPE:
|
asset_ids |
|
assets |
Return all assets associated with this run. |
client_key |
TYPE:
|
created_by_user_id |
TYPE:
|
created_date |
TYPE:
|
default_report_id |
TYPE:
|
description |
TYPE:
|
metadata |
|
model_config |
|
modified_by_user_id |
TYPE:
|
modified_date |
TYPE:
|
name |
TYPE:
|
organization_id |
TYPE:
|
start_time |
TYPE:
|
stop_time |
TYPE:
|
tags |
|
model_config
class-attribute
instance-attribute
¶
RunUpdate
¶
RunUpdate(**data: Any)
Bases: ModelUpdate[Run]
Update model for Run.
ATTRIBUTE | DESCRIPTION |
---|---|
client_key |
TYPE:
|
description |
TYPE:
|
is_pinned |
TYPE:
|
metadata |
|
model_config |
|
name |
TYPE:
|
start_time |
TYPE:
|
stop_time |
TYPE:
|
tags |
|