Skip to content

Data Columns

albert.resources.data_columns

DataColumn

Bases: BaseResource

The definition of a single measured result variable in Albert.

A Data Column (DAC) defines one direct output variable that a task can measure, such as Viscosity or APHA Color. Data columns are the reusable building blocks of a Data Template's results: a DataTemplate references data columns through its data_column_values, and the values recorded against a data column during experiments are stored as Property Data.

Data columns are identified by a Data Column ID (format DAC..., e.g. "DAC9999999") and are managed through DataColumnCollection, accessed as client.data_columns.

Example

from albert import Albert
from albert.resources.data_columns import DataColumn
client = Albert()
column = DataColumn(name="Viscosity")
created = client.data_columns.create(data_column=column)
created.id
# 'DAC9999999'
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"
    },
    "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"
    },
    "EntityLinkWithName": {
      "description": "EntityLink that includes the name field in serialization.",
      "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": "EntityLinkWithName",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "description": "The definition of a single measured result variable in Albert.\n\nA Data Column (DAC) defines one direct output variable that a task can\nmeasure, such as ``Viscosity`` or ``APHA Color``. Data columns are the\nreusable building blocks of a Data Template's results: a\n[`DataTemplate`][albert.resources.data_templates.DataTemplate] references data columns\nthrough its ``data_column_values``, and the values recorded against a data\ncolumn during experiments are stored as Property Data.\n\nData columns are identified by a Data Column ID (format ``DAC...``, e.g.\n``\"DAC9999999\"``) and are managed through\n[`DataColumnCollection`][albert.collections.data_columns.DataColumnCollection], accessed as\n``client.data_columns``.\n\n!!! example\n    ```python\n    from albert import Albert\n    from albert.resources.data_columns import DataColumn\n    client = Albert()\n    column = DataColumn(name=\"Viscosity\")\n    created = client.data_columns.create(data_column=column)\n    created.id\n    # 'DAC9999999'\n    ```",
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the resource, optional."
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the creation of the resource, optional."
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the update of the resource, optional."
    },
    "name": {
      "description": "The name of the data column (e.g. ``\"Viscosity\"``).",
      "title": "Name",
      "type": "string"
    },
    "default": {
      "type": "boolean",
      "default": false,
      "description": "Whether this is a default (platform-provided) data column.",
      "title": "Default"
    },
    "Metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/EntityLinkWithName"
              },
              {
                "$ref": "#/$defs/EntityLink"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/EntityLinkWithName"
                    },
                    {
                      "$ref": "#/$defs/EntityLink"
                    }
                  ]
                },
                "type": "array"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Custom metadata keyed by field name. Values may be strings, numbers, or entity links.",
      "title": "Metadata"
    },
    "albertId": {
      "default": null,
      "description": "The Data Column ID assigned by Albert (format ``DAC...``). Populated by the server on creation; leave unset when building a column to create.",
      "title": "Albertid",
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "title": "DataColumn",
  "type": "object"
}

Fields:

name

name: str

The name of the data column (e.g. "Viscosity").

default

default: bool = False

Whether this is a default (platform-provided) data column.

metadata

metadata: dict[str, MetadataItem] | None = None

Custom metadata keyed by field name. Values may be strings, numbers, or entity links.

id

id: str = None

The Data Column ID assigned by Albert (format DAC...). Populated by the server on creation; leave unset when building a column to create.

DataColumnSearchItemDataTemplate

Bases: BaseAlbertModel

A lightweight data template reference within a data column search result.

Show JSON schema:
{
  "$defs": {
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "description": "A lightweight data template reference within a data column search result.",
  "properties": {
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Albert ID of the data template (format ``DAT...``).",
      "title": "Albertid"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The name of the data template.",
      "title": "Name"
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the data template."
    }
  },
  "title": "DataColumnSearchItemDataTemplate",
  "type": "object"
}

Fields:

id

id: str | None = None

The Albert ID of the data template (format DAT...).

name

name: str | None = None

The name of the data template.

status

status: Status | None = None

The status of the data template.

DataColumnSearchItem

Bases: BaseAlbertModel, HydrationMixin[DataColumn]

Lightweight representation of a DataColumn returned from search.

Returned by search, this carries only summary fields for fast listing. Call hydrate() (or fetch by id via get_by_id) to obtain the fully populated DataColumn.

Show JSON schema:
{
  "$defs": {
    "DataColumnSearchItem": {
      "description": "Lightweight representation of a DataColumn returned from search.\n\nReturned by\n[`search`][albert.collections.data_columns.DataColumnCollection.search],\nthis carries only summary fields for fast listing. Call ``hydrate()`` (or fetch\nby ``id`` via\n[`get_by_id`][albert.collections.data_columns.DataColumnCollection.get_by_id])\nto obtain the fully populated\n[`DataColumn`][albert.resources.data_columns.DataColumn].",
      "properties": {
        "albertId": {
          "description": "The Data Column ID (format ``DAC...``).",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The name of the data column.",
          "title": "Name"
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/Status"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the data column."
        },
        "createdByName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The name of the user who created the data column.",
          "title": "Createdbyname"
        },
        "createdBy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the user who created the data column.",
          "title": "Createdby"
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO 8601 timestamp of when the data column was created.",
          "title": "Createdat"
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO 8601 timestamp of when the data column was last updated.",
          "title": "Updatedat"
        },
        "Metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Custom metadata attached to the data column.",
          "title": "Metadata"
        },
        "DataTemplates": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/DataColumnSearchItemDataTemplate"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The data templates that reference this data column.",
          "title": "Datatemplates"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The composite type of the data column (e.g. ``composite``, ``sub``), when applicable.",
          "title": "Type"
        },
        "parentDataColumn": {
          "anyOf": [
            {
              "$ref": "#/$defs/DataColumnSearchItem"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The parent data column, present on composite sub-column rows."
        },
        "subDataColumns": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/DataColumnSearchItem"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The sub data columns, present on composite parent rows.",
          "title": "Subdatacolumns"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "DataColumnSearchItem",
      "type": "object"
    },
    "DataColumnSearchItemDataTemplate": {
      "description": "A lightweight data template reference within a data column search result.",
      "properties": {
        "albertId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The Albert ID of the data template (format ``DAT...``).",
          "title": "Albertid"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The name of the data template.",
          "title": "Name"
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/Status"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the data template."
        }
      },
      "title": "DataColumnSearchItemDataTemplate",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "$ref": "#/$defs/DataColumnSearchItem"
}

Fields:

id

The Data Column ID (format DAC...).

name

name: str | None = None

The name of the data column.

status

status: Status | None = None

The status of the data column.

created_by_name

created_by_name: str | None = None

The name of the user who created the data column.

created_by

created_by: str | None = None

The ID of the user who created the data column.

created_at

created_at: str | None = None

ISO 8601 timestamp of when the data column was created.

updated_at

updated_at: str | None = None

ISO 8601 timestamp of when the data column was last updated.

metadata

metadata: dict[str, Any] | None = None

Custom metadata attached to the data column.

data_templates

data_templates: (
    list[DataColumnSearchItemDataTemplate] | None
) = None

The data templates that reference this data column.

type

type: str | None = None

The composite type of the data column (e.g. composite, sub), when applicable.

parent_data_column

parent_data_column: DataColumnSearchItem | None = None

The parent data column, present on composite sub-column rows.

sub_data_columns

sub_data_columns: list[DataColumnSearchItem] | None = None

The sub data columns, present on composite parent rows.