Notebooks
albert.resources.notebooks
Attributes:
| Name | Type | Description |
|---|---|---|
ListContent |
|
|
NotebookBlock |
|
|
NotebookContent |
|
|
allowed_notebook_contents |
|
ListContent
ListContent = Annotated[
NumberedListContent | BulletedListContent,
Field(discriminator="style"),
]
NotebookContent
NotebookContent = (
HeaderContent
| ParagraphContent
| ChecklistContent
| AttachesContent
| ImageContent
| KetcherContent
| TableContent
| BulletedListContent
| NumberedListContent
)
allowed_notebook_contents
allowed_notebook_contents = {
BlockType.HEADER: HeaderContent,
BlockType.PARAGRAPH: ParagraphContent,
BlockType.CHECKLIST: ChecklistContent,
BlockType.ATTACHES: AttachesContent,
BlockType.IMAGE: ImageContent,
BlockType.KETCHER: KetcherContent,
BlockType.TABLE: TableContent,
BlockType.LIST: (
BulletedListContent,
NumberedListContent,
),
}
ListBlockStyle
BlockType
The type of a notebook content block.
Attributes:
| Name | Type | Description |
|---|---|---|
PARAGRAPH |
str
|
A block of free text. |
LIST |
str
|
A bulleted or numbered list. |
HEADER |
str
|
A section heading. |
CHECKLIST |
str
|
A list of checkable items. |
IMAGE |
str
|
An embedded image. |
ATTACHES |
str
|
An attached file. |
KETCHER |
str
|
A chemical structure drawn in the Ketcher editor. |
TABLE |
str
|
A tabular grid of cells. |
NotebookCopyType
The kind of copy to perform when copying a notebook.
Attributes:
| Name | Type | Description |
|---|---|---|
TEMPLATE |
str
|
Copy into a notebook template. |
TASK |
str
|
Copy into a task. |
PROJECT |
str
|
Copy into a project. |
RESTORE_TEMPLATE |
str
|
Restore a notebook from a template. |
GEN_TASK_TEMPLATE |
str
|
Copy into a general task template. |
BaseBlock
Bases: BaseAlbertModel
Common fields shared by every notebook block.
Show JSON schema:
{
"description": "Common fields shared by every notebook block.",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
}
},
"title": "BaseBlock",
"type": "object"
}
Fields:
HeaderContent
Bases: BaseAlbertModel
The content of a header block.
Show JSON schema:
{
"description": "The content of a header block.",
"properties": {
"level": {
"description": "The heading level (1 is the largest heading).",
"minimum": 1,
"title": "Level",
"type": "integer"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The heading text.",
"title": "Text"
}
},
"required": [
"level",
"text"
],
"title": "HeaderContent",
"type": "object"
}
Fields:
HeaderBlock
Bases: BaseBlock
A section heading in a notebook.
Example
Show JSON schema:
{
"$defs": {
"HeaderContent": {
"description": "The content of a header block.",
"properties": {
"level": {
"description": "The heading level (1 is the largest heading).",
"minimum": 1,
"title": "Level",
"type": "integer"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The heading text.",
"title": "Text"
}
},
"required": [
"level",
"text"
],
"title": "HeaderContent",
"type": "object"
}
},
"description": "A section heading in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import HeaderBlock, HeaderContent\n\n block = HeaderBlock(content=HeaderContent(level=1, text=\"Procedure\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "header",
"default": "header",
"description": "Always [`HEADER`][albert.resources.notebooks.BlockType.HEADER].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/HeaderContent",
"description": "The heading level and text."
}
},
"required": [
"content"
],
"title": "HeaderBlock",
"type": "object"
}
Fields:
ParagraphContent
Bases: BaseAlbertModel
The content of a paragraph block.
Show JSON schema:
Fields:
ParagraphBlock
Bases: BaseBlock
A block of free text in a notebook.
Example
Show JSON schema:
{
"$defs": {
"ParagraphContent": {
"description": "The content of a paragraph block.",
"properties": {
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The paragraph text.",
"title": "Text"
}
},
"required": [
"text"
],
"title": "ParagraphContent",
"type": "object"
}
},
"description": "A block of free text in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ParagraphBlock, ParagraphContent\n\n block = ParagraphBlock(content=ParagraphContent(text=\"Weighed 1.2 g.\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "paragraph",
"default": "paragraph",
"description": "Always [`PARAGRAPH`][albert.resources.notebooks.BlockType.PARAGRAPH].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ParagraphContent",
"description": "The paragraph text."
}
},
"required": [
"content"
],
"title": "ParagraphBlock",
"type": "object"
}
Fields:
ChecklistItem
Bases: BaseAlbertModel
A single entry in a checklist block.
Show JSON schema:
{
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"type": "object"
}
Fields:
ChecklistContent
Bases: BaseAlbertModel
The content of a checklist block.
Show JSON schema:
{
"$defs": {
"ChecklistItem": {
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"type": "object"
}
},
"description": "The content of a checklist block.",
"properties": {
"items": {
"description": "The checklist entries, in order.",
"items": {
"$ref": "#/$defs/ChecklistItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "ChecklistContent",
"type": "object"
}
Fields:
ChecklistBlock
Bases: BaseBlock
A list of checkable items in a notebook.
Example
Show JSON schema:
{
"$defs": {
"ChecklistContent": {
"description": "The content of a checklist block.",
"properties": {
"items": {
"description": "The checklist entries, in order.",
"items": {
"$ref": "#/$defs/ChecklistItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "ChecklistContent",
"type": "object"
},
"ChecklistItem": {
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"type": "object"
}
},
"description": "A list of checkable items in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import (\n ChecklistBlock,\n ChecklistContent,\n ChecklistItem,\n )\n\n block = ChecklistBlock(\n content=ChecklistContent(\n items=[ChecklistItem(text=\"Calibrate scale\", checked=False)]\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "checklist",
"default": "checklist",
"description": "Always [`CHECKLIST`][albert.resources.notebooks.BlockType.CHECKLIST].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ChecklistContent",
"description": "The checklist items."
}
},
"required": [
"content"
],
"title": "ChecklistBlock",
"type": "object"
}
Fields:
is_checked
Return the checked state of a checklist item by its text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_text
|
str
|
The label text of the checklist entry to look up. |
required |
Returns:
| Type | Description |
|---|---|
bool | None
|
The checked state of the matching entry, or |
Source code in src/albert/resources/notebooks.py
AttachesContent
Bases: BaseAlbertModel
The content of a file attachment block.
Provide either file_path (a local file to upload) or file_key (an
already-uploaded file) when building the block.
Show JSON schema:
{
"description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the attachment. Defaults to the file name.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded file on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local file to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the file, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "AttachesContent",
"type": "object"
}
Fields:
-
title(str | None) -
namespace(str) -
file_key(str | None) -
format(str | None) -
file_path(str | Path | None) -
signed_url(str | None)
format
format: str | None = None
The MIME type of the file (e.g. "application/pdf"). Inferred from the file name if not set.
file_path
Path to a local file to upload. Not stored on the server.
signed_url
signed_url: str | None = None
A temporary download URL for the file, populated by Albert. Read-only.
AttachesBlock
Bases: BaseBlock
An attached file in a notebook.
Example
Show JSON schema:
{
"$defs": {
"AttachesContent": {
"description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the attachment. Defaults to the file name.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded file on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local file to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the file, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "AttachesContent",
"type": "object"
}
},
"description": "An attached file in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import AttachesBlock, AttachesContent\n\n block = AttachesBlock(\n content=AttachesContent(file_path=\"/path/to/spectrum.pdf\")\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "attaches",
"default": "attaches",
"description": "Always [`ATTACHES`][albert.resources.notebooks.BlockType.ATTACHES].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/AttachesContent",
"description": "The attachment details."
}
},
"required": [
"content"
],
"title": "AttachesBlock",
"type": "object"
}
Fields:
ImageContent
Bases: BaseAlbertModel
The content of an image block.
Provide either file_path (a local image to upload) or file_key (an
already-uploaded image) when building the block.
Show JSON schema:
{
"description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The caption or title of the image.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"stretched": {
"default": false,
"description": "Whether the image is stretched to full width.",
"title": "Stretched",
"type": "boolean"
},
"withBackground": {
"default": false,
"description": "Whether the image is shown with a background.",
"title": "Withbackground",
"type": "boolean"
},
"withBorder": {
"default": false,
"description": "Whether the image is shown with a border.",
"title": "Withborder",
"type": "boolean"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded image on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local image to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the image, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "ImageContent",
"type": "object"
}
Fields:
-
title(str | None) -
namespace(str) -
stretched(bool) -
with_background(bool) -
with_border(bool) -
file_key(str | None) -
format(str | None) -
file_path(str | Path | None) -
signed_url(str | None)
format
format: str | None = None
The MIME type of the image (e.g. "image/png"). Inferred from the file name if not set.
file_path
Path to a local image to upload. Not stored on the server.
signed_url
signed_url: str | None = None
A temporary download URL for the image, populated by Albert. Read-only.
ImageBlock
Bases: BaseBlock
An embedded image in a notebook.
Example
Show JSON schema:
{
"$defs": {
"ImageContent": {
"description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The caption or title of the image.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"stretched": {
"default": false,
"description": "Whether the image is stretched to full width.",
"title": "Stretched",
"type": "boolean"
},
"withBackground": {
"default": false,
"description": "Whether the image is shown with a background.",
"title": "Withbackground",
"type": "boolean"
},
"withBorder": {
"default": false,
"description": "Whether the image is shown with a border.",
"title": "Withborder",
"type": "boolean"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded image on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local image to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the image, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "ImageContent",
"type": "object"
}
},
"description": "An embedded image in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ImageBlock, ImageContent\n\n block = ImageBlock(content=ImageContent(file_path=\"/path/to/plot.png\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "image",
"default": "image",
"description": "Always [`IMAGE`][albert.resources.notebooks.BlockType.IMAGE].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ImageContent",
"description": "The image details."
}
},
"required": [
"content"
],
"title": "ImageBlock",
"type": "object"
}
Fields:
KetcherContent
Bases: BaseAlbertModel
The content of a Ketcher chemical-structure block.
When creating a new Ketcher block, set smiles to the structure's SMILES
string; the remaining fields are populated by Albert. Existing Ketcher blocks
cannot be edited in place.
Show JSON schema:
{
"description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
"properties": {
"synthesisId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
"title": "Synthesisid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal content ID.",
"title": "Id"
},
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block this content belongs to.",
"title": "Blockid"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The raw Ketcher canvas data.",
"title": "Data"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the rendered structure.",
"title": "Filekey"
},
"s3Key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the associated synthesis canvas.",
"title": "S3Key"
},
"png": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A PNG rendering of the structure.",
"title": "Png"
},
"stateType": {
"default": "project",
"description": "The state context of the drawing. Defaults to ``\"project\"``.",
"title": "Statetype",
"type": "string"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string describing the chemical structure.",
"title": "Smiles"
}
},
"title": "KetcherContent",
"type": "object"
}
Fields:
-
synthesis_id(SynthesisId | None) -
id(str | None) -
block_id(str | None) -
data(str | None) -
file_key(str | None) -
s3_key(str | None) -
png(str | None) -
state_type(str) -
smiles(str | None)
synthesis_id
synthesis_id: SynthesisId | None = None
The ID of the synthesis backing the drawing (format SYN...). Set by Albert when the block is created.
KetcherBlock
Bases: BaseBlock
A chemical structure drawn in the Ketcher editor.
Example
Show JSON schema:
{
"$defs": {
"KetcherContent": {
"description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
"properties": {
"synthesisId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
"title": "Synthesisid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal content ID.",
"title": "Id"
},
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block this content belongs to.",
"title": "Blockid"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The raw Ketcher canvas data.",
"title": "Data"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the rendered structure.",
"title": "Filekey"
},
"s3Key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the associated synthesis canvas.",
"title": "S3Key"
},
"png": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A PNG rendering of the structure.",
"title": "Png"
},
"stateType": {
"default": "project",
"description": "The state context of the drawing. Defaults to ``\"project\"``.",
"title": "Statetype",
"type": "string"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string describing the chemical structure.",
"title": "Smiles"
}
},
"title": "KetcherContent",
"type": "object"
}
},
"description": "A chemical structure drawn in the Ketcher editor.\n\n!!! example\n ```python\n from albert.resources.notebooks import KetcherBlock, KetcherContent\n\n block = KetcherBlock(content=KetcherContent(smiles=\"CCO\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "ketcher",
"default": "ketcher",
"description": "Always [`KETCHER`][albert.resources.notebooks.BlockType.KETCHER].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/KetcherContent",
"description": "The structure details, typically built from a SMILES string."
}
},
"required": [
"content"
],
"title": "KetcherBlock",
"type": "object"
}
Fields:
TableContent
Bases: BaseAlbertModel
The content of a table block.
Show JSON schema:
{
"description": "The content of a table block.",
"properties": {
"content": {
"description": "The table cells as a list of rows, each row a list of cell values.",
"items": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": "array"
},
"title": "Content",
"type": "array"
},
"withHeadings": {
"default": false,
"description": "Whether the first row should be treated as column headings.",
"title": "Withheadings",
"type": "boolean"
}
},
"required": [
"content"
],
"title": "TableContent",
"type": "object"
}
Fields:
TableBlock
Bases: BaseBlock
A tabular grid of cells in a notebook.
Example
Show JSON schema:
{
"$defs": {
"TableContent": {
"description": "The content of a table block.",
"properties": {
"content": {
"description": "The table cells as a list of rows, each row a list of cell values.",
"items": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": "array"
},
"title": "Content",
"type": "array"
},
"withHeadings": {
"default": false,
"description": "Whether the first row should be treated as column headings.",
"title": "Withheadings",
"type": "boolean"
}
},
"required": [
"content"
],
"title": "TableContent",
"type": "object"
}
},
"description": "A tabular grid of cells in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import TableBlock, TableContent\n\n block = TableBlock(\n content=TableContent(\n content=[[\"Trial\", \"Yield\"], [\"1\", \"82%\"]],\n with_headings=True,\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "table",
"default": "table",
"description": "Always [`TABLE`][albert.resources.notebooks.BlockType.TABLE].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/TableContent",
"description": "The table cells."
}
},
"required": [
"content"
],
"title": "TableBlock",
"type": "object"
}
Fields:
to_df
to_df(*, infer_header: bool = True) -> DataFrame
Convert the table block's content to a pandas DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
infer_header
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
The block's content as a pandas DataFrame. |
Source code in src/albert/resources/notebooks.py
NotebookListItem
Bases: BaseAlbertModel
A single entry in a list block, which may itself contain nested entries.
Show JSON schema:
{
"$defs": {
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
}
},
"$ref": "#/$defs/NotebookListItem"
}
Fields:
-
content(str | None) -
items(list[NotebookListItem])
BulletedListContent
Bases: BaseAlbertModel
The content of a bulleted (unordered) list block.
Show JSON schema:
{
"$defs": {
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
}
},
"description": "The content of a bulleted (unordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "unordered",
"default": "unordered",
"description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "BulletedListContent",
"type": "object"
}
Fields:
NumberedListContent
Bases: BaseAlbertModel
The content of a numbered (ordered) list block.
Show JSON schema:
{
"$defs": {
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
}
},
"description": "The content of a numbered (ordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "ordered",
"default": "ordered",
"description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "NumberedListContent",
"type": "object"
}
Fields:
ListBlock
Bases: BaseBlock
A bulleted or numbered list in a notebook.
Example
Show JSON schema:
{
"$defs": {
"BulletedListContent": {
"description": "The content of a bulleted (unordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "unordered",
"default": "unordered",
"description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "BulletedListContent",
"type": "object"
},
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
},
"NumberedListContent": {
"description": "The content of a numbered (ordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "ordered",
"default": "ordered",
"description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "NumberedListContent",
"type": "object"
}
},
"description": "A bulleted or numbered list in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import (\n ListBlock,\n BulletedListContent,\n NotebookListItem,\n )\n\n block = ListBlock(\n content=BulletedListContent(\n items=[NotebookListItem(content=\"First step\")]\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "list",
"default": "list",
"description": "Always [`LIST`][albert.resources.notebooks.BlockType.LIST].",
"title": "Blocktype",
"type": "string"
},
"content": {
"description": "The list entries and style.",
"discriminator": {
"mapping": {
"ordered": "#/$defs/NumberedListContent",
"unordered": "#/$defs/BulletedListContent"
},
"propertyName": "style"
},
"oneOf": [
{
"$ref": "#/$defs/NumberedListContent"
},
{
"$ref": "#/$defs/BulletedListContent"
}
],
"title": "Content"
}
},
"required": [
"content"
],
"title": "ListBlock",
"type": "object"
}
Fields:
NotebookLink
Bases: BaseAlbertModel
A link from a notebook to another Albert entity.
Show JSON schema:
{
"$defs": {
"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"
}
},
"description": "A link from a notebook to another Albert entity.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the link (format ``LNK...``).",
"title": "Id"
},
"Child": {
"$ref": "#/$defs/EntityLink",
"description": "The linked entity."
}
},
"required": [
"Child"
],
"title": "NotebookLink",
"type": "object"
}
Fields:
-
id(LinkId | None) -
child(EntityLink)
Notebook
Bases: BaseResource
An electronic lab notebook (ELN) in Albert.
A Notebook is an ordered document of content blocks (paragraphs, headers,
checklists, tables, images, attachments, lists, and Ketcher chemical drawings)
attached to a parent Project, Task, or custom template. Notebooks are created
empty and then populated block-by-block; see
NotebookCollection for the workflow.
Example
Show JSON schema:
{
"$defs": {
"AttachesBlock": {
"description": "An attached file in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import AttachesBlock, AttachesContent\n\n block = AttachesBlock(\n content=AttachesContent(file_path=\"/path/to/spectrum.pdf\")\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "attaches",
"default": "attaches",
"description": "Always [`ATTACHES`][albert.resources.notebooks.BlockType.ATTACHES].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/AttachesContent",
"description": "The attachment details."
}
},
"required": [
"content"
],
"title": "AttachesBlock",
"type": "object"
},
"AttachesContent": {
"description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the attachment. Defaults to the file name.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded file on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local file to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the file, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "AttachesContent",
"type": "object"
},
"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"
},
"BulletedListContent": {
"description": "The content of a bulleted (unordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "unordered",
"default": "unordered",
"description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "BulletedListContent",
"type": "object"
},
"ChecklistBlock": {
"description": "A list of checkable items in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import (\n ChecklistBlock,\n ChecklistContent,\n ChecklistItem,\n )\n\n block = ChecklistBlock(\n content=ChecklistContent(\n items=[ChecklistItem(text=\"Calibrate scale\", checked=False)]\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "checklist",
"default": "checklist",
"description": "Always [`CHECKLIST`][albert.resources.notebooks.BlockType.CHECKLIST].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ChecklistContent",
"description": "The checklist items."
}
},
"required": [
"content"
],
"title": "ChecklistBlock",
"type": "object"
},
"ChecklistContent": {
"description": "The content of a checklist block.",
"properties": {
"items": {
"description": "The checklist entries, in order.",
"items": {
"$ref": "#/$defs/ChecklistItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "ChecklistContent",
"type": "object"
},
"ChecklistItem": {
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"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"
},
"HeaderBlock": {
"description": "A section heading in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import HeaderBlock, HeaderContent\n\n block = HeaderBlock(content=HeaderContent(level=1, text=\"Procedure\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "header",
"default": "header",
"description": "Always [`HEADER`][albert.resources.notebooks.BlockType.HEADER].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/HeaderContent",
"description": "The heading level and text."
}
},
"required": [
"content"
],
"title": "HeaderBlock",
"type": "object"
},
"HeaderContent": {
"description": "The content of a header block.",
"properties": {
"level": {
"description": "The heading level (1 is the largest heading).",
"minimum": 1,
"title": "Level",
"type": "integer"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The heading text.",
"title": "Text"
}
},
"required": [
"level",
"text"
],
"title": "HeaderContent",
"type": "object"
},
"ImageBlock": {
"description": "An embedded image in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ImageBlock, ImageContent\n\n block = ImageBlock(content=ImageContent(file_path=\"/path/to/plot.png\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "image",
"default": "image",
"description": "Always [`IMAGE`][albert.resources.notebooks.BlockType.IMAGE].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ImageContent",
"description": "The image details."
}
},
"required": [
"content"
],
"title": "ImageBlock",
"type": "object"
},
"ImageContent": {
"description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The caption or title of the image.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"stretched": {
"default": false,
"description": "Whether the image is stretched to full width.",
"title": "Stretched",
"type": "boolean"
},
"withBackground": {
"default": false,
"description": "Whether the image is shown with a background.",
"title": "Withbackground",
"type": "boolean"
},
"withBorder": {
"default": false,
"description": "Whether the image is shown with a border.",
"title": "Withborder",
"type": "boolean"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded image on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local image to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the image, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "ImageContent",
"type": "object"
},
"KetcherBlock": {
"description": "A chemical structure drawn in the Ketcher editor.\n\n!!! example\n ```python\n from albert.resources.notebooks import KetcherBlock, KetcherContent\n\n block = KetcherBlock(content=KetcherContent(smiles=\"CCO\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "ketcher",
"default": "ketcher",
"description": "Always [`KETCHER`][albert.resources.notebooks.BlockType.KETCHER].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/KetcherContent",
"description": "The structure details, typically built from a SMILES string."
}
},
"required": [
"content"
],
"title": "KetcherBlock",
"type": "object"
},
"KetcherContent": {
"description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
"properties": {
"synthesisId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
"title": "Synthesisid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal content ID.",
"title": "Id"
},
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block this content belongs to.",
"title": "Blockid"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The raw Ketcher canvas data.",
"title": "Data"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the rendered structure.",
"title": "Filekey"
},
"s3Key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the associated synthesis canvas.",
"title": "S3Key"
},
"png": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A PNG rendering of the structure.",
"title": "Png"
},
"stateType": {
"default": "project",
"description": "The state context of the drawing. Defaults to ``\"project\"``.",
"title": "Statetype",
"type": "string"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string describing the chemical structure.",
"title": "Smiles"
}
},
"title": "KetcherContent",
"type": "object"
},
"ListBlock": {
"description": "A bulleted or numbered list in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import (\n ListBlock,\n BulletedListContent,\n NotebookListItem,\n )\n\n block = ListBlock(\n content=BulletedListContent(\n items=[NotebookListItem(content=\"First step\")]\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "list",
"default": "list",
"description": "Always [`LIST`][albert.resources.notebooks.BlockType.LIST].",
"title": "Blocktype",
"type": "string"
},
"content": {
"description": "The list entries and style.",
"discriminator": {
"mapping": {
"ordered": "#/$defs/NumberedListContent",
"unordered": "#/$defs/BulletedListContent"
},
"propertyName": "style"
},
"oneOf": [
{
"$ref": "#/$defs/NumberedListContent"
},
{
"$ref": "#/$defs/BulletedListContent"
}
],
"title": "Content"
}
},
"required": [
"content"
],
"title": "ListBlock",
"type": "object"
},
"NotebookLink": {
"description": "A link from a notebook to another Albert entity.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the link (format ``LNK...``).",
"title": "Id"
},
"Child": {
"$ref": "#/$defs/EntityLink",
"description": "The linked entity."
}
},
"required": [
"Child"
],
"title": "NotebookLink",
"type": "object"
},
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
},
"NumberedListContent": {
"description": "The content of a numbered (ordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "ordered",
"default": "ordered",
"description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "NumberedListContent",
"type": "object"
},
"ParagraphBlock": {
"description": "A block of free text in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ParagraphBlock, ParagraphContent\n\n block = ParagraphBlock(content=ParagraphContent(text=\"Weighed 1.2 g.\"))\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "paragraph",
"default": "paragraph",
"description": "Always [`PARAGRAPH`][albert.resources.notebooks.BlockType.PARAGRAPH].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ParagraphContent",
"description": "The paragraph text."
}
},
"required": [
"content"
],
"title": "ParagraphBlock",
"type": "object"
},
"ParagraphContent": {
"description": "The content of a paragraph block.",
"properties": {
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The paragraph text.",
"title": "Text"
}
},
"required": [
"text"
],
"title": "ParagraphContent",
"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"
},
"TableBlock": {
"description": "A tabular grid of cells in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import TableBlock, TableContent\n\n block = TableBlock(\n content=TableContent(\n content=[[\"Trial\", \"Yield\"], [\"1\", \"82%\"]],\n with_headings=True,\n )\n )\n ```",
"properties": {
"albertId": {
"description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
"title": "Albertid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the block, set by Albert.",
"title": "Version"
},
"blockType": {
"const": "table",
"default": "table",
"description": "Always [`TABLE`][albert.resources.notebooks.BlockType.TABLE].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/TableContent",
"description": "The table cells."
}
},
"required": [
"content"
],
"title": "TableBlock",
"type": "object"
},
"TableContent": {
"description": "The content of a table block.",
"properties": {
"content": {
"description": "The table cells as a list of rows, each row a list of cell values.",
"items": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": "array"
},
"title": "Content",
"type": "array"
},
"withHeadings": {
"default": false,
"description": "Whether the first row should be treated as column headings.",
"title": "Withheadings",
"type": "boolean"
}
},
"required": [
"content"
],
"title": "TableContent",
"type": "object"
}
},
"description": "An electronic lab notebook (ELN) in Albert.\n\nA Notebook is an ordered document of content blocks (paragraphs, headers,\nchecklists, tables, images, attachments, lists, and Ketcher chemical drawings)\nattached to a parent Project, Task, or custom template. Notebooks are created\nempty and then populated block-by-block; see\n[`NotebookCollection`][albert.collections.notebooks.NotebookCollection] for the workflow.\n\n!!! example\n ```python\n from albert.resources.notebooks import Notebook\n\n notebook = Notebook(name=\"Trial 1 log\", parent_id=\"PRO123\")\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."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the notebook (format ``NTB...``). Set once the notebook exists on Albert.",
"title": "Albertid"
},
"name": {
"default": "Untitled Notebook",
"description": "The notebook's name. Defaults to ``\"Untitled Notebook\"``.",
"title": "Name",
"type": "string"
},
"parentId": {
"description": "The entity the notebook is attached to (a Project ``PRO...``, Task ``TAS...``, or custom template ``CTP...``).",
"title": "Parentid",
"type": "string"
},
"version": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The version timestamp of the notebook, set by Albert.",
"title": "Version"
},
"blocks": {
"description": "The ordered content blocks of the notebook.",
"items": {
"discriminator": {
"mapping": {
"attaches": "#/$defs/AttachesBlock",
"checklist": "#/$defs/ChecklistBlock",
"header": "#/$defs/HeaderBlock",
"image": "#/$defs/ImageBlock",
"ketcher": "#/$defs/KetcherBlock",
"list": "#/$defs/ListBlock",
"paragraph": "#/$defs/ParagraphBlock",
"table": "#/$defs/TableBlock"
},
"propertyName": "blockType"
},
"oneOf": [
{
"$ref": "#/$defs/HeaderBlock"
},
{
"$ref": "#/$defs/ParagraphBlock"
},
{
"$ref": "#/$defs/ChecklistBlock"
},
{
"$ref": "#/$defs/AttachesBlock"
},
{
"$ref": "#/$defs/ImageBlock"
},
{
"$ref": "#/$defs/KetcherBlock"
},
{
"$ref": "#/$defs/TableBlock"
},
{
"$ref": "#/$defs/ListBlock"
}
]
},
"title": "Blocks",
"type": "array"
},
"links": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/NotebookLink"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Links from this notebook to other Albert entities.",
"title": "Links"
}
},
"required": [
"parentId"
],
"title": "Notebook",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(NotebookId | None) -
name(str) -
parent_id(ProjectId | TaskId | CustomTemplateId) -
version(datetime | None) -
blocks(list[NotebookBlock]) -
links(list[NotebookLink] | None)
id
id: NotebookId | None = None
The Albert ID of the notebook (format NTB...). Set once the notebook exists on Albert.
parent_id
parent_id: ProjectId | TaskId | CustomTemplateId
The entity the notebook is attached to (a Project PRO..., Task TAS..., or custom template CTP...).
PutOperation
PutBlockDatum
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"AttachesContent": {
"description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the attachment. Defaults to the file name.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded file on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local file to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the file, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "AttachesContent",
"type": "object"
},
"BlockType": {
"description": "The type of a notebook content block.\n\nAttributes\n----------\nPARAGRAPH : str\n A block of free text.\nLIST : str\n A bulleted or numbered list.\nHEADER : str\n A section heading.\nCHECKLIST : str\n A list of checkable items.\nIMAGE : str\n An embedded image.\nATTACHES : str\n An attached file.\nKETCHER : str\n A chemical structure drawn in the Ketcher editor.\nTABLE : str\n A tabular grid of cells.",
"enum": [
"paragraph",
"list",
"header",
"checklist",
"image",
"attaches",
"ketcher",
"table"
],
"title": "BlockType",
"type": "string"
},
"BulletedListContent": {
"description": "The content of a bulleted (unordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "unordered",
"default": "unordered",
"description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "BulletedListContent",
"type": "object"
},
"ChecklistContent": {
"description": "The content of a checklist block.",
"properties": {
"items": {
"description": "The checklist entries, in order.",
"items": {
"$ref": "#/$defs/ChecklistItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "ChecklistContent",
"type": "object"
},
"ChecklistItem": {
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"type": "object"
},
"HeaderContent": {
"description": "The content of a header block.",
"properties": {
"level": {
"description": "The heading level (1 is the largest heading).",
"minimum": 1,
"title": "Level",
"type": "integer"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The heading text.",
"title": "Text"
}
},
"required": [
"level",
"text"
],
"title": "HeaderContent",
"type": "object"
},
"ImageContent": {
"description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The caption or title of the image.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"stretched": {
"default": false,
"description": "Whether the image is stretched to full width.",
"title": "Stretched",
"type": "boolean"
},
"withBackground": {
"default": false,
"description": "Whether the image is shown with a background.",
"title": "Withbackground",
"type": "boolean"
},
"withBorder": {
"default": false,
"description": "Whether the image is shown with a border.",
"title": "Withborder",
"type": "boolean"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded image on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local image to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the image, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "ImageContent",
"type": "object"
},
"KetcherContent": {
"description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
"properties": {
"synthesisId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
"title": "Synthesisid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal content ID.",
"title": "Id"
},
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block this content belongs to.",
"title": "Blockid"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The raw Ketcher canvas data.",
"title": "Data"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the rendered structure.",
"title": "Filekey"
},
"s3Key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the associated synthesis canvas.",
"title": "S3Key"
},
"png": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A PNG rendering of the structure.",
"title": "Png"
},
"stateType": {
"default": "project",
"description": "The state context of the drawing. Defaults to ``\"project\"``.",
"title": "Statetype",
"type": "string"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string describing the chemical structure.",
"title": "Smiles"
}
},
"title": "KetcherContent",
"type": "object"
},
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
},
"NumberedListContent": {
"description": "The content of a numbered (ordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "ordered",
"default": "ordered",
"description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "NumberedListContent",
"type": "object"
},
"ParagraphContent": {
"description": "The content of a paragraph block.",
"properties": {
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The paragraph text.",
"title": "Text"
}
},
"required": [
"text"
],
"title": "ParagraphContent",
"type": "object"
},
"PutOperation": {
"description": "The operation to apply to a block when saving notebook content.\n\nAttributes\n----------\nUPDATE : str\n Create or update the block.\nDELETE : str\n Remove the block from the notebook.",
"enum": [
"update",
"delete"
],
"title": "PutOperation",
"type": "string"
},
"TableContent": {
"description": "The content of a table block.",
"properties": {
"content": {
"description": "The table cells as a list of rows, each row a list of cell values.",
"items": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": "array"
},
"title": "Content",
"type": "array"
},
"withHeadings": {
"default": false,
"description": "Whether the first row should be treated as column headings.",
"title": "Withheadings",
"type": "boolean"
}
},
"required": [
"content"
],
"title": "TableContent",
"type": "object"
}
},
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"operation": {
"$ref": "#/$defs/PutOperation"
},
"blockType": {
"anyOf": [
{
"$ref": "#/$defs/BlockType"
},
{
"type": "null"
}
],
"default": null
},
"content": {
"anyOf": [
{
"$ref": "#/$defs/HeaderContent"
},
{
"$ref": "#/$defs/ParagraphContent"
},
{
"$ref": "#/$defs/ChecklistContent"
},
{
"$ref": "#/$defs/AttachesContent"
},
{
"$ref": "#/$defs/ImageContent"
},
{
"$ref": "#/$defs/KetcherContent"
},
{
"$ref": "#/$defs/TableContent"
},
{
"$ref": "#/$defs/BulletedListContent"
},
{
"$ref": "#/$defs/NumberedListContent"
},
{
"type": "null"
}
],
"default": null,
"title": "Content"
},
"previousBlockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Previousblockid"
}
},
"required": [
"id",
"operation"
],
"title": "PutBlockDatum",
"type": "object"
}
Fields:
-
id(str) -
operation(PutOperation) -
type(BlockType | None) -
content(NotebookContent | None) -
previous_block_id(str | None)
Validators:
content_matches_type
content_matches_type() -> PutBlockDatum
Source code in src/albert/resources/notebooks.py
model_dump
Shallow model_dump to exclude None values (None only removed from top level). This ensures required attrs are not removed.
Source code in src/albert/resources/notebooks.py
PutBlockPayload
Bases: BaseAlbertModel
Show JSON schema:
{
"$defs": {
"AttachesContent": {
"description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the attachment. Defaults to the file name.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded file on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local file to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the file, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "AttachesContent",
"type": "object"
},
"BlockType": {
"description": "The type of a notebook content block.\n\nAttributes\n----------\nPARAGRAPH : str\n A block of free text.\nLIST : str\n A bulleted or numbered list.\nHEADER : str\n A section heading.\nCHECKLIST : str\n A list of checkable items.\nIMAGE : str\n An embedded image.\nATTACHES : str\n An attached file.\nKETCHER : str\n A chemical structure drawn in the Ketcher editor.\nTABLE : str\n A tabular grid of cells.",
"enum": [
"paragraph",
"list",
"header",
"checklist",
"image",
"attaches",
"ketcher",
"table"
],
"title": "BlockType",
"type": "string"
},
"BulletedListContent": {
"description": "The content of a bulleted (unordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "unordered",
"default": "unordered",
"description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "BulletedListContent",
"type": "object"
},
"ChecklistContent": {
"description": "The content of a checklist block.",
"properties": {
"items": {
"description": "The checklist entries, in order.",
"items": {
"$ref": "#/$defs/ChecklistItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "ChecklistContent",
"type": "object"
},
"ChecklistItem": {
"description": "A single entry in a checklist block.",
"properties": {
"checked": {
"description": "Whether the item is checked.",
"title": "Checked",
"type": "boolean"
},
"text": {
"description": "The item's label text.",
"title": "Text",
"type": "string"
}
},
"required": [
"checked",
"text"
],
"title": "ChecklistItem",
"type": "object"
},
"HeaderContent": {
"description": "The content of a header block.",
"properties": {
"level": {
"description": "The heading level (1 is the largest heading).",
"minimum": 1,
"title": "Level",
"type": "integer"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The heading text.",
"title": "Text"
}
},
"required": [
"level",
"text"
],
"title": "HeaderContent",
"type": "object"
},
"ImageContent": {
"description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The caption or title of the image.",
"title": "Title"
},
"namespace": {
"default": "result",
"description": "The file storage namespace. Defaults to ``\"result\"``.",
"title": "Namespace",
"type": "string"
},
"stretched": {
"default": false,
"description": "Whether the image is stretched to full width.",
"title": "Stretched",
"type": "boolean"
},
"withBackground": {
"default": false,
"description": "Whether the image is shown with a background.",
"title": "Withbackground",
"type": "boolean"
},
"withBorder": {
"default": false,
"description": "Whether the image is shown with a border.",
"title": "Withborder",
"type": "boolean"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the uploaded image on Albert.",
"title": "Filekey"
},
"mimeType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
"title": "Mimetype"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a local image to upload. Not stored on the server.",
"title": "File Path"
},
"signedURL": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A temporary download URL for the image, populated by Albert. Read-only.",
"title": "Signedurl"
}
},
"title": "ImageContent",
"type": "object"
},
"KetcherContent": {
"description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
"properties": {
"synthesisId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
"title": "Synthesisid"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal content ID.",
"title": "Id"
},
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block this content belongs to.",
"title": "Blockid"
},
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The raw Ketcher canvas data.",
"title": "Data"
},
"fileKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the rendered structure.",
"title": "Filekey"
},
"s3Key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The storage key of the associated synthesis canvas.",
"title": "S3Key"
},
"png": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A PNG rendering of the structure.",
"title": "Png"
},
"stateType": {
"default": "project",
"description": "The state context of the drawing. Defaults to ``\"project\"``.",
"title": "Statetype",
"type": "string"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES string describing the chemical structure.",
"title": "Smiles"
}
},
"title": "KetcherContent",
"type": "object"
},
"NotebookListItem": {
"description": "A single entry in a list block, which may itself contain nested entries.",
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The item's text.",
"title": "Content"
},
"items": {
"description": "Nested sub-items beneath this entry.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
}
},
"required": [
"content"
],
"title": "NotebookListItem",
"type": "object"
},
"NumberedListContent": {
"description": "The content of a numbered (ordered) list block.",
"properties": {
"items": {
"description": "The list entries, in order.",
"items": {
"$ref": "#/$defs/NotebookListItem"
},
"title": "Items",
"type": "array"
},
"style": {
"const": "ordered",
"default": "ordered",
"description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
"title": "Style",
"type": "string"
}
},
"required": [
"items"
],
"title": "NumberedListContent",
"type": "object"
},
"ParagraphContent": {
"description": "The content of a paragraph block.",
"properties": {
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The paragraph text.",
"title": "Text"
}
},
"required": [
"text"
],
"title": "ParagraphContent",
"type": "object"
},
"PutBlockDatum": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"operation": {
"$ref": "#/$defs/PutOperation"
},
"blockType": {
"anyOf": [
{
"$ref": "#/$defs/BlockType"
},
{
"type": "null"
}
],
"default": null
},
"content": {
"anyOf": [
{
"$ref": "#/$defs/HeaderContent"
},
{
"$ref": "#/$defs/ParagraphContent"
},
{
"$ref": "#/$defs/ChecklistContent"
},
{
"$ref": "#/$defs/AttachesContent"
},
{
"$ref": "#/$defs/ImageContent"
},
{
"$ref": "#/$defs/KetcherContent"
},
{
"$ref": "#/$defs/TableContent"
},
{
"$ref": "#/$defs/BulletedListContent"
},
{
"$ref": "#/$defs/NumberedListContent"
},
{
"type": "null"
}
],
"default": null,
"title": "Content"
},
"previousBlockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Previousblockid"
}
},
"required": [
"id",
"operation"
],
"title": "PutBlockDatum",
"type": "object"
},
"PutOperation": {
"description": "The operation to apply to a block when saving notebook content.\n\nAttributes\n----------\nUPDATE : str\n Create or update the block.\nDELETE : str\n Remove the block from the notebook.",
"enum": [
"update",
"delete"
],
"title": "PutOperation",
"type": "string"
},
"TableContent": {
"description": "The content of a table block.",
"properties": {
"content": {
"description": "The table cells as a list of rows, each row a list of cell values.",
"items": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"type": "array"
},
"title": "Content",
"type": "array"
},
"withHeadings": {
"default": false,
"description": "Whether the first row should be treated as column headings.",
"title": "Withheadings",
"type": "boolean"
}
},
"required": [
"content"
],
"title": "TableContent",
"type": "object"
}
},
"properties": {
"data": {
"items": {
"$ref": "#/$defs/PutBlockDatum"
},
"title": "Data",
"type": "array"
}
},
"required": [
"data"
],
"title": "PutBlockPayload",
"type": "object"
}
Fields:
model_dump
model_dump to ensure only top-level None attrs are removed on PutBlockDatum.
NotebookCopyACL
Bases: BaseResource
Access settings applied to a copied notebook.
Warning
Deprecated and will be removed in 2.0. Use ACLContainer instead.
Show JSON schema:
{
"$defs": {
"ACL": {
"description": "A single access rule for a user.",
"properties": {
"id": {
"description": "The id of the user for which this ACL applies",
"title": "Id",
"type": "string"
},
"fgc": {
"anyOf": [
{
"$ref": "#/$defs/AccessControlLevel"
},
{
"type": "null"
}
],
"default": null,
"description": "The Fine-Grain Control Level"
}
},
"required": [
"id"
],
"title": "ACL",
"type": "object"
},
"AccessControlLevel": {
"description": "Access control levels you can grant users.",
"enum": [
"ProjectOwner",
"ProjectEditor",
"ProjectViewer",
"ProjectAllTask",
"ProjectStrictViewer",
"ProjectPropertyTask",
"InventoryOwner",
"InventoryViewer",
"CustomTemplateOwner",
"CustomTemplateViewer",
"CASFullAccess"
],
"title": "AccessControlLevel",
"type": "string"
},
"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"
},
"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": "Access settings applied to a copied notebook.\n\nWarning\n-----\nDeprecated and will be removed in 2.0. Use ``ACLContainer`` instead.",
"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."
},
"fgclist": {
"default": null,
"description": "Specific access rules for users or teams.",
"items": {
"$ref": "#/$defs/ACL"
},
"title": "Fgclist",
"type": "array"
},
"class": {
"description": "Default access class (for example, \"restricted\" or \"confidential\").",
"title": "Class",
"type": "string"
}
},
"required": [
"class"
],
"title": "NotebookCopyACL",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
fgclist(list[ACL]) -
acl_class(str)
Source code in src/albert/resources/notebooks.py
NotebookCopyInfo
Bases: BaseAlbertModel
Instructions for copying a notebook into a new parent.
Example
Show JSON schema:
{
"$defs": {
"ACL": {
"description": "A single access rule for a user.",
"properties": {
"id": {
"description": "The id of the user for which this ACL applies",
"title": "Id",
"type": "string"
},
"fgc": {
"anyOf": [
{
"$ref": "#/$defs/AccessControlLevel"
},
{
"type": "null"
}
],
"default": null,
"description": "The Fine-Grain Control Level"
}
},
"required": [
"id"
],
"title": "ACL",
"type": "object"
},
"ACLContainer": {
"description": "Access settings with a default class and a list of rules.",
"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."
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The default access class (for example, \"restricted\" or \"confidential\").",
"title": "Class"
},
"fgclist": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ACL"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Specific access rules for users or teams.",
"title": "Fgclist"
}
},
"title": "ACLContainer",
"type": "object"
},
"AccessControlLevel": {
"description": "Access control levels you can grant users.",
"enum": [
"ProjectOwner",
"ProjectEditor",
"ProjectViewer",
"ProjectAllTask",
"ProjectStrictViewer",
"ProjectPropertyTask",
"InventoryOwner",
"InventoryViewer",
"CustomTemplateOwner",
"CustomTemplateViewer",
"CASFullAccess"
],
"title": "AccessControlLevel",
"type": "string"
},
"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"
},
"NotebookCopyACL": {
"description": "Access settings applied to a copied notebook.\n\nWarning\n-----\nDeprecated and will be removed in 2.0. Use ``ACLContainer`` instead.",
"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."
},
"fgclist": {
"default": null,
"description": "Specific access rules for users or teams.",
"items": {
"$ref": "#/$defs/ACL"
},
"title": "Fgclist",
"type": "array"
},
"class": {
"description": "Default access class (for example, \"restricted\" or \"confidential\").",
"title": "Class",
"type": "string"
}
},
"required": [
"class"
],
"title": "NotebookCopyACL",
"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": "Instructions for copying a notebook into a new parent.\n\n!!! example\n ```python\n from albert.resources.notebooks import NotebookCopyInfo\n\n info = NotebookCopyInfo(id=\"NTB123\", parent_id=\"PRO456\")\n ```",
"properties": {
"id": {
"description": "The ID of the source notebook to copy (format ``NTB...``).",
"title": "Id",
"type": "string"
},
"parentId": {
"description": "The ID of the destination parent to copy the notebook into.",
"title": "Parentid",
"type": "string"
},
"notebookName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name to give the copied notebook.",
"title": "Notebookname"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "An optional alternative name for the copy.",
"title": "Name"
},
"acl": {
"anyOf": [
{
"$ref": "#/$defs/ACLContainer"
},
{
"$ref": "#/$defs/NotebookCopyACL"
},
{
"type": "null"
}
],
"default": null,
"description": "Access-control settings to apply to the copy.",
"title": "Acl"
}
},
"required": [
"id",
"parentId"
],
"title": "NotebookCopyInfo",
"type": "object"
}
Fields:
-
id(NotebookId) -
parent_id(str) -
notebook_name(str | None) -
name(str | None) -
acl(ACLContainer | NotebookCopyACL | None)