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:
DataColumnValue
Bases: BaseAlbertModel
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"
},
"DataColumn": {
"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"
},
"defalt": {
"default": false,
"title": "Defalt",
"type": "boolean"
},
"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"
},
"albertId": {
"default": null,
"title": "Albertid",
"type": "string"
}
},
"required": [
"name"
],
"title": "DataColumn",
"type": "object"
},
"DataType": {
"enum": [
"number",
"string",
"enum"
],
"title": "DataType",
"type": "string"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EnumValidationValue": {
"description": "Represents a value for an enum type validation.\n\nAttributes\n----------\ntext : str\n The text of the enum value.\nid : str | None\n The ID of the enum value. If not provided, the ID will be generated upon creation.",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"originalText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Originaltext"
}
},
"required": [
"text"
],
"title": "EnumValidationValue",
"type": "object"
},
"Operator": {
"enum": [
"between",
"lt",
"lte",
"gte",
"gt",
"eq"
],
"title": "Operator",
"type": "string"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"Unit": {
"description": "Unit is a Pydantic model representing a unit entity.\n\nAttributes\n----------\nid : str | None\n The Albert ID of the unit. Set when the unit is retrieved from Albert.\nname : str\n The name of the unit.\nsymbol : str | None\n The symbol of the unit.\nsynonyms : List[str] | None\n The list of synonyms for the unit.\ncategory : UnitCategory\n The category of the unit.\nverified : bool | None\n Whether the unit is verified.\nstatus : Status | None\n The status of the unit. Allowed values are `active`, and `inactive`",
"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"
},
"symbol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Symbol"
},
"Synonyms": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Synonyms"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/UnitCategory"
},
{
"type": "null"
}
],
"default": null
},
"verified": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Verified"
}
},
"required": [
"name"
],
"title": "Unit",
"type": "object"
},
"UnitCategory": {
"description": "UnitCategory is an enumeration of possible unit categories.\n\nAttributes\n----------\nLENGTH : str\n Represents length units.\nVOLUME : str\n Represents volume units.\nLIQUID_VOLUME : str\n Represents liquid volume units.\nANGLES : str\n Represents angle units.\nTIME : str\n Represents time units.\nFREQUENCY : str\n Represents frequency units.\nMASS : str\n Represents mass units.\nCURRENT : str\n Represents electric current units.\nTEMPERATURE : str\n Represents temperature units.\nAMOUNT : str\n Represents amount of substance units.\nLUMINOSITY : str\n Represents luminous intensity units.\nFORCE : str\n Represents force units.\nENERGY : str\n Represents energy units.\nPOWER : str\n Represents power units.\nPRESSURE : str\n Represents pressure units.\nELECTRICITY_AND_MAGNETISM : str\n Represents electricity and magnetism units.\nOTHER : str\n Represents other units.\nWEIGHT : str\n Represents weight units.",
"enum": [
"Length",
"Volume",
"Liquid volume",
"Angles",
"Time",
"Frequency",
"Mass",
"Electric current",
"Temperature",
"Amount of substance",
"Luminous intensity",
"Force",
"Energy",
"Power",
"Pressure",
"Electricity and magnetism",
"Other",
"Weight",
"Area",
"Surface Area",
"Binary",
"Capacitance",
"Speed",
"Electrical conductivity",
"Electrical permitivitty",
"Density",
"Resistance"
],
"title": "UnitCategory",
"type": "string"
},
"ValueValidation": {
"properties": {
"datatype": {
"$ref": "#/$defs/DataType"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"$ref": "#/$defs/EnumValidationValue"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"min": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"datatype"
],
"title": "ValueValidation",
"type": "object"
}
},
"properties": {
"data_column": {
"$ref": "#/$defs/DataColumn",
"default": null
},
"id": {
"default": null,
"title": "Id",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"hidden": {
"default": false,
"title": "Hidden",
"type": "boolean"
},
"Unit": {
"anyOf": [
{
"$ref": "#/$defs/Unit"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"title": "Unit"
},
"calculation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Calculation"
},
"sequence": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sequence"
},
"validation": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ValueValidation"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Validation"
}
},
"title": "DataColumnValue",
"type": "object"
}
Fields:
-
data_column
(DataColumn
) -
data_column_id
(str
) -
value
(str | None
) -
hidden
(bool
) -
unit
(SerializeAsEntityLink[Unit] | None
) -
calculation
(str | None
) -
sequence
(str | None
) -
validation
(list[ValueValidation] | None
)
Validators:
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
|
|
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,
)
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:
-
_collection
(BaseCollection | None
) -
id
(str
) -
name
(str
) -
data_columns
(list[DataTemplateSearchItemDataColumn] | None
)