Data Templates
albert.resources.data_templates
CSVMapping
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"mapId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": "Header1:DAC2900#Header2:DAC4707",
"title": "Mapid"
},
"mapData": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"examples": {
"Header1": "DAC2900",
"Header2": "DAC4707"
},
"title": "Mapdata"
}
},
"title": "CSVMapping",
"type": "object"
}
Fields:
CurveDBMetadata
StorageKeyReference
Bases: BaseAlbertModel
Show JSON schema:
{
"properties": {
"rawfile": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rawfile"
},
"s3Input": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "S3Input"
},
"s3Output": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "S3Output"
},
"preview": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Preview"
},
"thumb": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Thumb"
},
"original": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Original"
}
},
"title": "StorageKeyReference",
"type": "object"
}
Fields:
JobSummary
Bases: BaseAlbertModel
Show JSON schema:
Fields:
CurveDataEntityLink
DataColumnValue
Bases: BaseResource
Methods:
| Name | Description |
|---|---|
check_for_id |
|
Attributes:
| Name | Type | Description |
|---|---|---|
data_column |
DataColumn | None
|
|
data_column_id |
DataColumnId | None
|
|
name |
str | None
|
|
original_name |
str | None
|
|
value |
str | None
|
|
hidden |
bool
|
|
unit |
SerializeAsEntityLink[Unit] | None
|
|
calculation |
str | None
|
|
sequence |
str | None
|
|
script |
bool | None
|
|
db_metadata |
CurveDBMetadata | None
|
|
storage_key_reference |
StorageKeyReference | None
|
|
job |
JobSummary | None
|
|
csv_mapping |
dict[str, str] | CSVMapping | None
|
|
validation |
list[ValueValidation] | None
|
|
curve_data |
list[CurveDataEntityLink] | None
|
|
created |
AuditFields | None
|
|
original_name
original_name: str | None = Field(
default=None,
alias="originalName",
exclude=True,
frozen=True,
)
storage_key_reference
storage_key_reference: StorageKeyReference | None = Field(
default=None, alias="s3Key"
)
csv_mapping
csv_mapping: dict[str, str] | CSVMapping | None = Field(
default=None, alias="csvMapping"
)
curve_data
curve_data: list[CurveDataEntityLink] | None = Field(
default=None,
validation_alias=AliasChoices("CurveData", "curveData"),
serialization_alias="curveData",
)
created
created: AuditFields | None = Field(
default=None,
alias="Created",
validation_alias=AliasChoices("Created", "Added"),
serialization_alias="Added",
)
check_for_id
Source code in src/albert/resources/data_templates.py
DataTemplate
Bases: BaseTaggedResource
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
id |
DataTemplateId | None
|
|
description |
str | None
|
|
security_class |
SecurityClass | None
|
|
verified |
bool
|
|
users_with_access |
list[SerializeAsEntityLink[User]] | None
|
|
data_column_values |
list[DataColumnValue] | None
|
|
parameter_values |
list[ParameterValue] | None
|
|
deleted_parameters |
list[ParameterValue] | None
|
|
metadata |
dict[str, MetadataItem] | None
|
|
documents |
list[EntityLink]
|
|
original_name |
str | None
|
|
full_name |
str | None
|
|
users_with_access
data_column_values
data_column_values: list[DataColumnValue] | None = Field(
alias="DataColumns", default=None
)
parameter_values
parameter_values: list[ParameterValue] | None = Field(
alias="Parameters", default=None
)
deleted_parameters
deleted_parameters: list[ParameterValue] | None = Field(
alias="DeletedParameters",
default=None,
frozen=True,
exclude=True,
)
documents
documents: list[EntityLink] = Field(
default_factory=list,
alias="Documents",
exclude=True,
frozen=True,
)
original_name
original_name: str | None = Field(
default=None,
alias="originalName",
exclude=True,
frozen=True,
)
full_name
full_name: str | None = Field(
default=None,
alias="fullName",
exclude=True,
frozen=True,
)
ImportMode
CurveExample
Bases: BaseAlbertModel
Curve example data for a data template column.
Attributes:
| Name | Type | Description |
|---|---|---|
mode |
ImportMode
|
|
field_mapping |
dict[str, str] | None
|
Optional header-to-curve-result mapping, e.g. |
file_path |
str | Path | None
|
Local path to source CSV file. |
attachment_id |
AttachmentId | None
|
Existing attachment ID of source CSV file. Provide exactly one source CSV (local path or existing attachment). |
Show JSON schema:
{
"$defs": {
"ImportMode": {
"enum": [
"SCRIPT",
"CSV"
],
"title": "ImportMode",
"type": "string"
}
},
"description": "Curve example data for a data template column.\n\nAttributes\n----------\nmode : ImportMode\n ``ImportMode.CSV`` ingests the CSV directly; ``ImportMode.SCRIPT`` runs the attached\n script first (requires a script attachment on the column).\nfield_mapping : dict[str, str] | None\n Optional header-to-curve-result mapping, e.g. ``{\"visc\": \"Viscosity\"}``. Overrides\n auto-detected mappings.\nfile_path : str | Path | None\n Local path to source CSV file.\nattachment_id : AttachmentId | None\n Existing attachment ID of source CSV file.\n Provide exactly one source CSV (local path or existing attachment).",
"properties": {
"type": {
"const": "curve",
"default": "curve",
"title": "Type",
"type": "string"
},
"mode": {
"$ref": "#/$defs/ImportMode",
"default": "CSV"
},
"field_mapping": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Field Mapping"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "File Path"
},
"attachment_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Attachment Id"
}
},
"title": "CurveExample",
"type": "object"
}
Fields:
-
type(Literal[CURVE]) -
mode(ImportMode) -
field_mapping(dict[str, str] | None) -
file_path(str | Path | None) -
attachment_id(AttachmentId | None)
Validators:
-
_require_curve_source
ImageExample
Bases: BaseAlbertModel
Example data for an image data column.
Show JSON schema:
{
"description": "Example data for an image data column.",
"properties": {
"type": {
"const": "image",
"default": "image",
"title": "Type",
"type": "string"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
}
],
"title": "File Path"
}
},
"required": [
"file_path"
],
"title": "ImageExample",
"type": "object"
}
Fields:
DataTemplateSearchItemDataColumn
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"LocalizedNames": {
"properties": {
"de": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "De"
},
"ja": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ja"
},
"zh": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Zh"
},
"es": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Es"
}
},
"title": "LocalizedNames",
"type": "object"
}
},
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"localizedNames": {
"$ref": "#/$defs/LocalizedNames"
}
},
"required": [
"id",
"localizedNames"
],
"title": "DataTemplateSearchItemDataColumn",
"type": "object"
}
Fields:
-
id(str) -
name(str | None) -
localized_names(LocalizedNames)
DataTemplateSearchItem
Bases: BaseAlbertModel, HydrationMixin[DataTemplate]
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"DataTemplateSearchItemDataColumn": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"localizedNames": {
"$ref": "#/$defs/LocalizedNames"
}
},
"required": [
"id",
"localizedNames"
],
"title": "DataTemplateSearchItemDataColumn",
"type": "object"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"LocalizedNames": {
"properties": {
"de": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "De"
},
"ja": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ja"
},
"zh": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Zh"
},
"es": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Es"
}
},
"title": "LocalizedNames",
"type": "object"
},
"Location": {
"description": "A location in Albert.\n\nAttributes\n----------\nname : str\n The name of the location.\nid : str | None\n The Albert ID of the location. Set when the location is retrieved from Albert.\nlatitude : float\n The latitude of the location.\nlongitude : float\n The longitude of the location.\naddress : str\n The address of the location.\ncountry : str | None\n The country code of the location. Must be two characters long.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"latitude": {
"title": "Latitude",
"type": "number"
},
"longitude": {
"title": "Longitude",
"type": "number"
},
"address": {
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"Role": {
"description": "A role in Albert. Note: Roles are not currently creatable via the SDK.\n\nAttributes\n----------\nname : str\n The name of the role.\nid : str\n The Albert ID of the role. Set when the role is retrieved from Albert.\npolicies : list[Any] | None\n The policies associated with the role.\ntenant : str\n The tenant ID of the role.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"name": {
"title": "Name",
"type": "string"
},
"Policies": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Policies"
},
"tenant": {
"title": "Tenant",
"type": "string"
},
"visibility": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Visibility"
}
},
"required": [
"name",
"tenant"
],
"title": "Role",
"type": "object"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"Tag": {
"description": "Tag is a Pydantic model representing a tag entity.\n\nAttributes\n----------\ntag : str\n The name of the tag.\nid : str | None\n The Albert ID of the tag. Set when the tag is retrieved from Albert.\n\nMethods\n-------\nfrom_string(tag: str) -> \"Tag\"\n Creates a Tag object from a string.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
}
},
"required": [
"name"
],
"title": "Tag",
"type": "object"
},
"User": {
"description": "Represents a User on the Albert Platform\n\nAttributes\n----------\nname : str\n The name of the user.\nid : str | None\n The Albert ID of the user. Set when the user is retrieved from Albert.\nlocation : Location | None\n The location of the user.\nemail : EmailStr | None\n The email of the user.\nroles : list[Role]\n The roles of the user.\nuser_class : UserClass\n The ACL class level of the user.\nmetadata : dict[str, str | list[EntityLink] | EntityLink] | None",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"title": "Location"
},
"email": {
"default": null,
"format": "email",
"title": "Email",
"type": "string"
},
"Roles": {
"items": {
"anyOf": [
{
"$ref": "#/$defs/Role"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"maxItems": 1,
"title": "Roles",
"type": "array"
},
"userClass": {
"$ref": "#/$defs/UserClass",
"default": "standard"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"$ref": "#/$defs/EntityLink"
},
"type": "array"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Metadata"
}
},
"required": [
"name"
],
"title": "User",
"type": "object"
},
"UserClass": {
"description": "The ACL class level of the user",
"enum": [
"guest",
"standard",
"trusted",
"privileged",
"admin"
],
"title": "UserClass",
"type": "string"
}
},
"properties": {
"albertId": {
"title": "Albertid",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"dataColumns": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/DataTemplateSearchItemDataColumn"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumns"
},
"owner": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/User"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Owner"
},
"tags": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/Tag"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Tags"
},
"acl": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/User"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Acl"
},
"createdAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Createdat"
},
"createdByName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Createdbyname"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Metadata"
},
"team": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/User"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Team"
},
"standards": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Standards"
}
},
"required": [
"albertId",
"name"
],
"title": "DataTemplateSearchItem",
"type": "object"
}
Fields:
-
id(str) -
name(str) -
data_columns(list[DataTemplateSearchItemDataColumn] | None) -
owner(list[SerializeAsEntityLink[User]] | None) -
tags(list[SerializeAsEntityLink[Tag]] | None) -
acl(list[SerializeAsEntityLink[User]] | None) -
created_at(str | None) -
created_by_name(str | None) -
metadata(dict[str, Any] | None) -
team(list[SerializeAsEntityLink[User]] | None) -
standards(list[dict[str, Any]] | None)