Property Data
albert.collections.property_data
DataColumnId
module-attribute
DataTemplateId
module-attribute
SearchInventoryId
module-attribute
SearchProjectId
module-attribute
AlbertPaginator
AlbertPaginator(
*,
path: str,
mode: PaginationMode,
session: AlbertSession,
deserialize: Callable[
[Iterable[dict]], Iterable[ItemType]
],
params: dict[str, str] | None = None,
)
Bases: Iterator[ItemType]
Helper class for pagination through Albert endpoints.
Two pagination modes are possible:
- Offset-based via by the offset query parameter
- Key-based via by the startKey query parameter and 'lastKey' response field
A custom deserialize function is provided when additional logic is required to load
the raw items returned by the search listing, e.g., making additional Albert API calls.
Source code in src/albert/core/pagination.py
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
auth_manager: AlbertClientCredentials
| AlbertSSOClient
| None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
The base URL to prefix to all relative request paths (e.g., "https://app.albertinvent.com"). |
required |
token
|
str | None
|
A static JWT token for authentication. Ignored if |
None
|
auth_manager
|
AlbertClientCredentials | AlbertSSOClient
|
An authentication manager used to dynamically fetch and refresh tokens.
If provided, it overrides |
None
|
retries
|
int
|
The number of automatic retries on failed requests (default is 3). |
None
|
Methods:
| Name | Description |
|---|---|
request |
|
Source code in src/albert/core/session.py
request
Source code in src/albert/core/session.py
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
BulkPropertyData
pydantic-model
Bases: BaseAlbertModel
A Simple Data Structure representing all the columns of data in a block's data column.
Show JSON schema:
{
"$defs": {
"BulkPropertyDataColumn": {
"description": "A Simple Data Structure representing all the rows of data in a block's data column.",
"properties": {
"data_column_name": {
"default": null,
"description": "The name of the data column (case sensitive).",
"title": "Data Column Name",
"type": "string"
},
"data_series": {
"description": "The values, in order of row number, for the data column.",
"items": {
"type": "string"
},
"title": "Data Series",
"type": "array"
}
},
"title": "BulkPropertyDataColumn",
"type": "object"
}
},
"description": "A Simple Data Structure representing all the columns of data in a block's data column.",
"properties": {
"columns": {
"description": "The columns of data in the block's data column.",
"items": {
"$ref": "#/$defs/BulkPropertyDataColumn"
},
"title": "Columns",
"type": "array"
}
},
"title": "BulkPropertyData",
"type": "object"
}
Fields:
columns
pydantic-field
columns: list[BulkPropertyDataColumn]
The columns of data in the block's data column.
from_dataframe
classmethod
from_dataframe(df: DataFrame) -> BulkPropertyData
Converts a DataFrame to a BulkPropertyData object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The DataFrame to convert. |
required |
Returns:
| Type | Description |
|---|---|
BulkPropertyData
|
The BulkPropertyData object that represents the data in the DataFrame. |
Source code in src/albert/resources/property_data.py
CheckPropertyData
Bases: BaseResource
block_id
class-attribute
instance-attribute
block_id: str | None = Field(default=None, alias='blockId')
data_exists
class-attribute
instance-attribute
data_exists: bool | None = Field(
default=None, alias="dataExist"
)
interval_id
class-attribute
instance-attribute
interval_id: str | None = Field(
default=None, alias="interval"
)
inventory_id
class-attribute
instance-attribute
inventory_id: str | None = Field(
default=None, alias="inventoryId"
)
DataEntity
InventoryDataColumn
pydantic-model
Bases: BaseAlbertModel
Show JSON schema:
Fields:
-
data_column_id(DataColumnId | None) -
value(str | None)
InventoryPropertyData
Bases: BaseResource
custom_property_data
class-attribute
instance-attribute
inventory_name
class-attribute
instance-attribute
inventory_name: str | None = Field(
default=None, alias="inventoryName"
)
InventoryPropertyDataCreate
Bases: BaseResource
data_columns
class-attribute
instance-attribute
data_columns: list[InventoryDataColumn] = Field(
default_factory=list, max_length=1, alias="DataColumn"
)
NotFoundError
OrderBy
PaginationMode
PropertyDataCollection
PropertyDataCollection(*, session: AlbertSession)
Bases: BaseCollection
PropertyDataCollection is a collection class for managing Property Data entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
| Name | Description |
|---|---|
add_properties_to_inventory |
Add new properties to an inventory item. |
add_properties_to_task |
Add new task properties for a given task. |
bulk_delete_task_data |
Bulk delete task data for a given task. |
bulk_load_task_properties |
Bulk load task properties for a given task. WARNING: This will overwrite any existing properties! |
check_block_interval_for_data |
Check if a specific block interval has data. |
check_for_task_data |
Checks if a task has data. |
get_all_task_properties |
Returns all the properties for a specific task. |
get_properties_on_inventory |
Returns all the properties of an inventory item. |
get_task_block_properties |
Returns all the properties within a Property Task block for a specific inventory item. |
search |
Search for property data with various filtering options. |
update_or_create_task_properties |
Update or create task properties for a given task. |
update_property_on_inventory |
Update a property on an inventory item. |
update_property_on_task |
Updates a specific property on a task. |
Source code in src/albert/collections/property_data.py
add_properties_to_inventory
add_properties_to_inventory(
*,
inventory_id: InventoryId,
properties: list[InventoryDataColumn],
) -> list[InventoryPropertyDataCreate]
Add new properties to an inventory item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to add properties to. |
required |
properties
|
list[InventoryDataColumn]
|
The properties to add. |
required |
Returns:
| Type | Description |
|---|---|
list[InventoryPropertyDataCreate]
|
The registered properties. |
Source code in src/albert/collections/property_data.py
add_properties_to_task
add_properties_to_task(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
properties: list[TaskPropertyCreate],
)
Add new task properties for a given task.
This method only works for new values. If a trial number is provided in the TaskPropertyCreate, it must relate to an existing trial. New trials must be added with no trial number provided. Do not try to create multiple new trials in one call as this will lead to unexpected behavior. Build out new trials in a loop if many new trials are needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
properties
|
list[TaskPropertyCreate]
|
A list of TaskPropertyCreate objects representing the properties to add. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
The newly created task properties. |
Source code in src/albert/collections/property_data.py
bulk_delete_task_data
bulk_delete_task_data(
*,
task_id: TaskId,
block_id: BlockId,
inventory_id: InventoryId,
lot_id: LotId | None = None,
interval_id=None,
) -> None
Bulk delete task data for a given task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
interval_id
|
IntervalId
|
The ID of the interval, by default None. If provided, will delete data for this specific interval. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
bulk_load_task_properties
bulk_load_task_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
property_data: BulkPropertyData,
interval="default",
lot_id: LotId = None,
) -> list[TaskPropertyData]
Bulk load task properties for a given task. WARNING: This will overwrite any existing properties! BulkPropertyData column names must exactly match the names of the data columns (Case Sensitive).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
interval
|
str
|
The interval to use for the properties, by default "default". Can be obtained using Workflow.get_interval_id(). |
'default'
|
property_data
|
BulkPropertyData
|
A list of columnwise data containing all your rows of data for a single interval. Can be created using BulkPropertyData.from_dataframe(). |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
The updated or newly created task properties. |
Example
from albert.resources.property_data import BulkPropertyData
data = BulkPropertyData.from_dataframe(df=my_dataframe)
res = client.property_data.bulk_load_task_properties(
block_id="BLK1",
inventory_id="INVEXP102748-042",
property_data=data,
task_id="TASFOR291760",
)
[TaskPropertyData(id="TASFOR291760", ...)]
Source code in src/albert/collections/property_data.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
check_block_interval_for_data
check_block_interval_for_data(
*,
block_id: BlockId,
task_id: TaskId,
interval_id: IntervalId,
) -> CheckPropertyData
Check if a specific block interval has data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block_id
|
BlockId
|
The ID of the block. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
IntervalId
|
The ID of the interval. |
required |
Returns:
| Type | Description |
|---|---|
CheckPropertyData
|
description |
Source code in src/albert/collections/property_data.py
check_for_task_data
check_for_task_data(
*, task_id: TaskId
) -> list[CheckPropertyData]
Checks if a task has data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task to check for data. |
required |
Returns:
| Type | Description |
|---|---|
list[CheckPropertyData]
|
A list of CheckPropertyData objects representing the data status of each block + inventory item of the task. |
Source code in src/albert/collections/property_data.py
get_all_task_properties
get_all_task_properties(
*, task_id: TaskId
) -> list[TaskPropertyData]
Returns all the properties for a specific task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task to retrieve properties for. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
A list of TaskPropertyData objects representing the properties within the task. |
Source code in src/albert/collections/property_data.py
get_properties_on_inventory
get_properties_on_inventory(
*, inventory_id: InventoryId
) -> InventoryPropertyData
Returns all the properties of an inventory item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to retrieve properties for. |
required |
Returns:
| Type | Description |
|---|---|
InventoryPropertyData
|
The properties of the inventory item. |
Source code in src/albert/collections/property_data.py
get_task_block_properties
get_task_block_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> TaskPropertyData
Returns all the properties within a Property Task block for a specific inventory item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The Property task ID. |
required |
block_id
|
BlockId
|
The Block ID of the block to retrieve properties for. |
required |
lot_id
|
LotId | None
|
The specific Lot of the inventory Item to retrieve lots for, by default None |
None
|
Returns:
| Type | Description |
|---|---|
TaskPropertyData
|
The properties of the inventory item within the block. |
Source code in src/albert/collections/property_data.py
search
search(
*,
limit: int = 100,
result: str | None = None,
text: str | None = None,
order: OrderBy | None = None,
sort_by: str | None = None,
inventory_ids: list[SearchInventoryId]
| SearchInventoryId
| None = None,
project_ids: list[SearchProjectId]
| SearchProjectId
| None = None,
lot_ids: list[LotId] | LotId | None = None,
data_template_ids: DataTemplateId
| list[DataTemplateId]
| None = None,
data_column_ids: DataColumnId
| list[DataColumnId]
| None = None,
category: list[DataEntity] | DataEntity | None = None,
data_templates: list[str] | str | None = None,
data_columns: list[str] | str | None = None,
parameters: list[str] | str | None = None,
parameter_group: list[str] | str | None = None,
unit: list[str] | str | None = None,
created_by: list[UserId] | UserId | None = None,
task_created_by: list[UserId] | UserId | None = None,
return_fields: list[str] | str | None = None,
return_facets: list[str] | str | None = None,
) -> Iterator[PropertyDataSearchItem]
Search for property data with various filtering options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of results to return. |
100
|
result
|
str
|
Find results using search syntax. e.g. to find all results with viscosity < 200 at a temperature of 25 we would do result=viscosity(<200)@temperature(25) |
None
|
text
|
str
|
Free text search across all searchable fields. |
None
|
order
|
OrderBy
|
Sort order (ascending/descending). |
None
|
sort_by
|
str
|
Field to sort results by. |
None
|
inventory_ids
|
SearchInventoryIdType or list of SearchInventoryIdType
|
Filter by inventory IDs. |
None
|
project_ids
|
ProjectIdType or list of ProjectIdType
|
Filter by project IDs. |
None
|
lot_ids
|
LotIdType or list of LotIdType
|
Filter by lot IDs. |
None
|
data_template_ids
|
DataTemplateId or list of DataTemplateId
|
Filter by data template IDs. |
None
|
data_column_ids
|
DataColumnId | list[DataColumnId] | None
|
Filter by data column IDs. |
None
|
category
|
DataEntity or list of DataEntity
|
Filter by data entity categories. |
None
|
data_templates
|
str or list of str (exact match)
|
Filter by data template names. |
None
|
data_columns
|
str or list of str (exact match)
|
Filter by data column names (currently non-functional). |
None
|
parameters
|
str or list of str (exact match)
|
Filter by parameter names. |
None
|
parameter_group
|
str or list of str (exact match)
|
Filter by parameter group names. |
None
|
unit
|
str or list of str (exact match)
|
Filter by unit names. |
None
|
created_by
|
UserIdType or list of UserIdType
|
Filter by creator user IDs. |
None
|
task_created_by
|
UserIdType or list of UserIdType
|
Filter by task creator user IDs. |
None
|
return_fields
|
str or list of str
|
Specific fields to include in results. If None, returns all fields. |
None
|
return_facets
|
str or list of str
|
Specific facets to include in results. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Search results matching the specified criteria. |
Source code in src/albert/collections/property_data.py
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | |
update_or_create_task_properties
update_or_create_task_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
properties: list[TaskPropertyCreate],
) -> list[TaskPropertyData]
Update or create task properties for a given task.
If a trial number is provided in the TaskPropertyCreate, it must relate to an existing trial. New trials must be added with no trial number provided. Do not try to create multiple new trials in one call as this will lead to unexpected behavior. Build out new trials in a loop if many new trials are needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
properties
|
list[TaskPropertyCreate]
|
A list of TaskPropertyCreate objects representing the properties to update or create. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
The updated or newly created task properties. |
Source code in src/albert/collections/property_data.py
update_property_on_inventory
update_property_on_inventory(
*,
inventory_id: InventoryId,
property_data: InventoryDataColumn,
) -> InventoryPropertyData
Update a property on an inventory item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to update the property on. |
required |
property_data
|
InventoryDataColumn
|
The updated property data. |
required |
Returns:
| Type | Description |
|---|---|
InventoryPropertyData
|
The updated property data as returned by the server. |
Source code in src/albert/collections/property_data.py
update_property_on_task
update_property_on_task(
*,
task_id: TaskId,
patch_payload: list[PropertyDataPatchDatum],
) -> list[TaskPropertyData]
Updates a specific property on a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
patch_payload
|
list[PropertyDataPatchDatum]
|
The specific patch to make to update the property. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
A list of TaskPropertyData objects representing the properties within the task. |
Source code in src/albert/collections/property_data.py
PropertyDataPatchDatum
Bases: PatchDatum
property_column_id
class-attribute
instance-attribute
property_column_id: DataColumnId | PropertyDataId = Field(
alias="id"
)
PropertyDataSearchItem
pydantic-model
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"PropertyDataResult": {
"properties": {
"valueNumeric": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuenumeric"
},
"name": {
"title": "Name",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"trial": {
"title": "Trial",
"type": "string"
},
"valueString": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuestring"
}
},
"required": [
"name",
"id",
"trial"
],
"title": "PropertyDataResult",
"type": "object"
},
"WorkflowItem": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"parameterGroupId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parametergroupid"
},
"valueNumeric": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuenumeric"
},
"unitName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitname"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitid"
}
},
"required": [
"name",
"id"
],
"title": "WorkflowItem",
"type": "object"
}
},
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"category": {
"title": "Category",
"type": "string"
},
"workflow": {
"items": {
"$ref": "#/$defs/WorkflowItem"
},
"title": "Workflow",
"type": "array"
},
"result": {
"$ref": "#/$defs/PropertyDataResult"
},
"dataTemplateId": {
"title": "Datatemplateid",
"type": "string"
},
"workflowName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflowname"
},
"parentId": {
"title": "Parentid",
"type": "string"
},
"dataTemplateName": {
"title": "Datatemplatename",
"type": "string"
},
"createdBy": {
"title": "Createdby",
"type": "string"
},
"inventoryId": {
"title": "Inventoryid",
"type": "string"
},
"projectId": {
"title": "Projectid",
"type": "string"
},
"workflowId": {
"title": "Workflowid",
"type": "string"
},
"taskId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Taskid"
}
},
"required": [
"id",
"category",
"workflow",
"result",
"dataTemplateId",
"parentId",
"dataTemplateName",
"createdBy",
"inventoryId",
"projectId",
"workflowId"
],
"title": "PropertyDataSearchItem",
"type": "object"
}
Fields:
-
id(PropertyDataId) -
category(str) -
workflow(list[WorkflowItem]) -
result(PropertyDataResult) -
data_template_id(DataTemplateId) -
workflow_name(str | None) -
parent_id(TaskId | InventoryId) -
data_template_name(str) -
created_by(str) -
inventory_id(InventoryId) -
project_id(ProjectId) -
workflow_id(WorkflowId) -
task_id(TaskId | None)
PropertyTask
Bases: BaseTask
Represents a batch task.
This class is used to create and manage batch tasks. It includes the base task attributes and additional attributes specific to batch tasks.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the batch task. |
inventory_information |
list[TaskInventoryInformation]
|
Information about the inventory associated with the batch task. |
location |
SerializeAsEntityLink[Location]
|
The location where the batch task is performed. |
parent_id |
str
|
The ID of the parent project. |
blocks |
list[Block]
|
A list of blocks associated with the batch task. |
id |
(str, optional)
|
The ID of the batch task, by default None. |
metadata |
(dict[str, MetadataItem], optional)
|
Metadata associated with the batch task, by default an empty dictionary. |
due_date |
(str, optional)
|
The due date of the batch task. YYY-MM-DD format, by default None. |
notes |
(str, optional)
|
Notes associated with the batch task, by default None. |
priority |
(TaskPriority, optional)
|
The priority of the batch task, by default None. |
assigned_to |
(SerializeAsEntityLink[User], optional)
|
The user assigned to the batch task, by default None. |
state |
(TaskState, optional)
|
The state of the batch task, by default None. |
sources |
(list[TaskSource], optional)
|
A list of sources associated with the batch task, by default an empty list. |
security_class |
(SecurityClass, optional)
|
The security class of the batch task, by default None. |
start_date |
str, read only
|
The start date of the batch task, by default None. |
claimed_date |
str, read only
|
The claimed date of the batch task, by default None. |
completed_date |
str, read only
|
The completed date of the batch task, by default None. |
closed_date |
str, read only
|
The closed date of the batch task, by default None. |
batch_task_id
class-attribute
instance-attribute
batch_task_id: str | None = Field(
alias="batchTaskId", default=None
)
blocks
class-attribute
instance-attribute
blocks: list[Block] | None = Field(
alias="Blocks", default=None
)
qc_task
class-attribute
instance-attribute
qc_task: bool | None = Field(alias='qcTask', default=None)
PropertyValue
pydantic-model
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"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"PropertyData": {
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
}
},
"title": "PropertyData",
"type": "object"
},
"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"
}
},
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"sequence": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sequence"
},
"calculation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Calculation"
},
"valueNumeric": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuenumeric"
},
"valueString": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuestring"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"Unit": {
"anyOf": [
{
"$ref": "#/$defs/Unit"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"additionalProperties": true,
"type": "object"
}
],
"title": "Unit"
},
"PropertyData": {
"anyOf": [
{
"$ref": "#/$defs/PropertyData"
},
{
"type": "null"
}
],
"default": null
},
"dataColumnUniqueId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumnuniqueid"
},
"hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Hidden"
}
},
"title": "PropertyValue",
"type": "object"
}
Fields:
-
id(str | None) -
name(str | None) -
sequence(str | None) -
calculation(str | None) -
numeric_value(float | None) -
string_value(str | None) -
value(str | None) -
unit(SerializeAsEntityLink[Unit] | dict) -
property_data(PropertyData | None) -
data_column_unique_id(str | None) -
hidden(bool | None)
TaskCollection
TaskCollection(*, session: AlbertSession)
Bases: BaseCollection
TaskCollection is a collection class for managing Task entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert Session information |
required |
Methods:
| Name | Description |
|---|---|
add_block |
Add a block to a Property task. |
create |
Create a new task. Tasks can be of different types, such as PropertyTask, and are created using the provided task object. |
delete |
Delete a task. |
get_all |
Retrieve fully hydrated Task entities with optional filters. |
get_by_id |
Retrieve a task by its ID. |
get_history |
|
remove_block |
Remove a block from a Property task. |
search |
Search for Task matching the provided criteria. |
update |
Update a task. |
update_block_workflow |
Update the workflow of a specific block within a task. |
Source code in src/albert/collections/tasks.py
add_block
add_block(
*,
task_id: TaskId,
data_template_id: DataTemplateId,
workflow_id: WorkflowId,
) -> None
Add a block to a Property task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task to add the block to. |
required |
data_template_id
|
DataTemplateId
|
The ID of the data template to use for the block. |
required |
workflow_id
|
WorkflowId
|
The ID of the workflow to assign to the block. |
required |
Returns:
| Type | Description |
|---|---|
None
|
This method does not return any value. |
Source code in src/albert/collections/tasks.py
create
create(
*, task: PropertyTask | GeneralTask | BatchTask
) -> BaseTask
Create a new task. Tasks can be of different types, such as PropertyTask, and are created using the provided task object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
PropertyTask | GeneralTask | BatchTask
|
The task object to create. |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The registered task object. |
Source code in src/albert/collections/tasks.py
delete
delete(*, id: TaskId) -> None
Delete a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
TaskId
|
The ID of the task to delete. |
required |
get_all
get_all(
*, params: TaskFilterParams | None = None
) -> Iterator[BaseTask]
Retrieve fully hydrated Task entities with optional filters.
This method returns complete entity data using get_by_id or get_by_ids.
Use :meth:search for faster retrieval when you only need lightweight, partial (unhydrated) entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
TaskFilterParams
|
Filter and pagination options passed to the search query. |
None
|
Yields:
| Type | Description |
|---|---|
Iterator[BaseTask]
|
A stream of fully hydrated Task objects (PropertyTask, BatchTask, or GeneralTask). |
Source code in src/albert/collections/tasks.py
get_by_id
Retrieve a task by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
TaskId
|
The ID of the task to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The task object with the provided ID. |
Source code in src/albert/collections/tasks.py
get_history
get_history(
*,
id: TaskId,
order: OrderBy = DESCENDING,
limit: int = 1000,
entity: HistoryEntity | None = None,
blockId: str | None = None,
startKey: str | None = None,
) -> TaskHistory
Source code in src/albert/collections/tasks.py
remove_block
Remove a block from a Property task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
str
|
ID of the Task to remove the block from (e.g., TASFOR1234) |
required |
block_id
|
str
|
ID of the Block to remove (e.g., BLK1) |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/tasks.py
search
search(
*, params: TaskFilterParams | None = None
) -> Iterator[TaskSearchItem]
Search for Task matching the provided criteria.
⚠️ This method returns partial (unhydrated) entities to optimize performance.
To retrieve fully detailed entities, use :meth:get_all instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
TaskFilterParams
|
Structured query parameters including filters, sort order, and pagination. |
None
|
Yields:
| Type | Description |
|---|---|
Iterator[BaseTask]
|
An iterator of matching, fully hydrated Task objects. |
Source code in src/albert/collections/tasks.py
update
Update a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
BaseTask
|
The updated Task object. |
required |
Returns:
| Type | Description |
|---|---|
BaseTask
|
The updated Task object as it exists in the Albert platform. |
Source code in src/albert/collections/tasks.py
update_block_workflow
update_block_workflow(
*,
task_id: TaskId,
block_id: BlockId,
workflow_id: WorkflowId,
) -> None
Update the workflow of a specific block within a task.
This method updates the workflow of a specified block within a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
str
|
The ID of the task. |
required |
block_id
|
str
|
The ID of the block within the task. |
required |
workflow_id
|
str
|
The ID of the new workflow to be assigned to the block. |
required |
Returns:
| Type | Description |
|---|---|
None
|
This method does not return any value. |
Notes
- The method asserts that the retrieved task is an instance of
PropertyTask. - If the block's current workflow matches the new workflow ID, no update is performed.
- The method handles the case where the block has a default workflow named "No Parameter Group".
Source code in src/albert/collections/tasks.py
TaskDataColumn
pydantic-model
Bases: BaseAlbertModel
Show JSON schema:
Fields:
-
data_column_id(DataColumnId) -
column_sequence(str | None)
TaskPropertyCreate
Bases: BaseResource
Represents a task property to be created.
This class is used to create new task properties. Users can use the Workflowe.get_interval_id
method to find the correct interval given the names and setpoints of the parameters.
Notes
- Users can use
Workflow.get_interval_id(parameter_values={"name1":"value1", "name2":"value2"})to find the correct interval given the names and setpoints of the parameters. - Leave
trial_numberblank to create a new row/trial. visible_trial_numbercan be used to set the relative row number, allowing you to pass multiple rows of data at once.
Methods:
| Name | Description |
|---|---|
set_visible_trial_number |
|
data_column
class-attribute
instance-attribute
data_column: TaskDataColumn = Field(
...,
alias="DataColumns",
description="The data column associated with the task property.",
)
data_template
class-attribute
instance-attribute
data_template: SerializeAsEntityLink[DataTemplate] = Field(
...,
alias="DataTemplate",
description="The data template associated with the task property.",
)
entity
class-attribute
instance-attribute
entity: Literal[TASK] = Field(
default=TASK,
description="The entity type, which is always `DataEntity.TASK` for task properties.",
)
interval_combination
class-attribute
instance-attribute
interval_combination: str = Field(
alias="intervalCombination",
examples=["default", "ROW4XROW2", "ROW2"],
default="default",
description="The interval combination, which can be found using `Workflow.get_interval_id`.",
)
trial_number
class-attribute
instance-attribute
trial_number: int = Field(
alias="trialNo",
default=None,
description="The trial number/ row number. Leave blank to create a new row/trial.",
)
value
class-attribute
instance-attribute
value: str | None = Field(
default=None,
description="The value of the task property.",
)
visible_trial_number
class-attribute
instance-attribute
visible_trial_number: int | None = Field(
alias="visibleTrialNo",
default=None,
description="Can be used to set the relative row number, allowing you to pass multiple rows of data at once.",
)
set_visible_trial_number
set_visible_trial_number() -> TaskPropertyCreate
Source code in src/albert/resources/property_data.py
TaskPropertyData
Bases: BaseResource
block_id
class-attribute
instance-attribute
block_id: str | None = Field(alias='blockId', default=None)
data
class-attribute
instance-attribute
data: list[DataInterval] = Field(
alias="Data", frozen=True, exclude=True
)
data_template
class-attribute
instance-attribute
data_template: (
SerializeAsEntityLink[DataTemplate] | None
) = Field(default=None, alias="DataTemplate")
finial_workflow
class-attribute
instance-attribute
finial_workflow: SerializeAsEntityLink[Workflow] | None = (
Field(default=None, alias="FinalWorkflow")
)
initial_workflow
class-attribute
instance-attribute
initial_workflow: SerializeAsEntityLink[Workflow] | None = (
Field(default=None, alias="InitialWorkflow")
)
inventory
class-attribute
instance-attribute
Trial
pydantic-model
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"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"PropertyData": {
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
}
},
"title": "PropertyData",
"type": "object"
},
"PropertyValue": {
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"sequence": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sequence"
},
"calculation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Calculation"
},
"valueNumeric": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuenumeric"
},
"valueString": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Valuestring"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Value"
},
"Unit": {
"anyOf": [
{
"$ref": "#/$defs/Unit"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"additionalProperties": true,
"type": "object"
}
],
"title": "Unit"
},
"PropertyData": {
"anyOf": [
{
"$ref": "#/$defs/PropertyData"
},
{
"type": "null"
}
],
"default": null
},
"dataColumnUniqueId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Datacolumnuniqueid"
},
"hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Hidden"
}
},
"title": "PropertyValue",
"type": "object"
},
"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"
}
},
"properties": {
"trialNo": {
"title": "Trialno",
"type": "integer"
},
"visibleTrialNo": {
"default": 1,
"title": "Visibletrialno",
"type": "integer"
},
"void": {
"default": false,
"title": "Void",
"type": "boolean"
},
"DataColumns": {
"items": {
"$ref": "#/$defs/PropertyValue"
},
"title": "Datacolumns",
"type": "array"
}
},
"required": [
"trialNo"
],
"title": "Trial",
"type": "object"
}
Fields: