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"
    },
    "defalt": {
      "default": false,
      "title": "Defalt",
      "type": "boolean"
    },
    "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").

defalt

defalt: bool = False

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.