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": {
"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"
},
"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": {
"albertId": {
"title": "Albertid",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"dataColumns": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/DataTemplateSearchItemDataColumn"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumns"
}
},
"required": [
"albertId",
"name"
],
"title": "DataTemplateSearchItem",
"type": "object"
}
Fields:
-
id(str) -
name(str) -
data_columns(list[DataTemplateSearchItemDataColumn] | None)