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
| OfficeContent
| ReportContent
| LiveCanvasContent
)
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,
),
BlockType.WORD: OfficeContent,
BlockType.EXCEL: OfficeContent,
BlockType.POWERPOINT: OfficeContent,
BlockType.REPORT: ReportContent,
BlockType.LIVE_CANVAS: LiveCanvasContent,
}
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. |
WORD |
str
|
A Microsoft Word document (wire value |
EXCEL |
str
|
A Microsoft Excel workbook (wire value |
POWERPOINT |
str
|
A Microsoft PowerPoint presentation (wire value |
REPORT |
str
|
An embedded Albert report. |
LIVE_CANVAS |
str
|
An embedded Artifact (wire value |
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:
OfficeContent
Bases: BaseAlbertModel
The content of a Microsoft Office block (Word, Excel, or PowerPoint).
Office blocks are created with empty content; Albert generates the backing
document and populates title and file_key.
Show JSON schema:
{
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"type": "object"
}
Fields:
WordBlock
Bases: BaseBlock
A Microsoft Word document embedded in a notebook.
Show JSON schema:
{
"$defs": {
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"type": "object"
}
},
"description": "A Microsoft Word document embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import WordBlock\n\n block = WordBlock()\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": "msdocx",
"default": "msdocx",
"description": "Always [`WORD`][albert.resources.notebooks.BlockType.WORD].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The Word document details."
}
},
"title": "WordBlock",
"type": "object"
}
Fields:
ExcelBlock
Bases: BaseBlock
A Microsoft Excel workbook embedded in a notebook.
Show JSON schema:
{
"$defs": {
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"type": "object"
}
},
"description": "A Microsoft Excel workbook embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ExcelBlock\n\n block = ExcelBlock()\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": "msxlsx",
"default": "msxlsx",
"description": "Always [`EXCEL`][albert.resources.notebooks.BlockType.EXCEL].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The Excel workbook details."
}
},
"title": "ExcelBlock",
"type": "object"
}
Fields:
PowerPointBlock
Bases: BaseBlock
A Microsoft PowerPoint presentation embedded in a notebook.
Show JSON schema:
{
"$defs": {
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"type": "object"
}
},
"description": "A Microsoft PowerPoint presentation embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import PowerPointBlock\n\n block = PowerPointBlock()\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": "mspptx",
"default": "mspptx",
"description": "Always [`POWERPOINT`][albert.resources.notebooks.BlockType.POWERPOINT].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The PowerPoint presentation details."
}
},
"title": "PowerPointBlock",
"type": "object"
}
Fields:
-
id(str) -
version(datetime | None) -
type(Literal[POWERPOINT]) -
content(OfficeContent)
ReportContent
Bases: BaseAlbertModel
The content of a report block.
Report blocks embed an Albert report in a notebook. The API stores the content as a free-form object, so unknown fields are preserved on the model.
Show JSON schema:
Config:
extra:allow
ReportBlock
Bases: BaseBlock
An Albert report embedded in a notebook.
Show JSON schema:
{
"$defs": {
"ReportContent": {
"additionalProperties": true,
"description": "The content of a report block.\n\nReport blocks embed an Albert report in a notebook. The API stores the\ncontent as a free-form object, so unknown fields are preserved on the model.",
"properties": {},
"title": "ReportContent",
"type": "object"
}
},
"description": "An Albert report embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ReportBlock\n\n block = ReportBlock()\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": "report",
"default": "report",
"description": "Always [`REPORT`][albert.resources.notebooks.BlockType.REPORT].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ReportContent",
"description": "The report block payload."
}
},
"title": "ReportBlock",
"type": "object"
}
Fields:
LiveCanvasContent
Bases: BaseAlbertModel
The content of an Artifact block.
The block points at an Artifact; the Artifact's own content is stored and versioned separately. Unknown fields are preserved on the model so a read-modify-write round trip sends the block back unchanged.
Show JSON schema:
{
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"type": "object"
}
Config:
extra:allow
Fields:
LiveCanvasBlock
Bases: BaseBlock
An Artifact embedded in a notebook.
Artifact blocks are placed by sharing an Artifact to a notebook. Read them to
find which Artifact is embedded; keep them in the blocks list unchanged
when saving notebook content so the embed is not removed.
Example
Show JSON schema:
{
"$defs": {
"LiveCanvasContent": {
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"type": "object"
}
},
"description": "An Artifact embedded in a notebook.\n\nArtifact blocks are placed by sharing an Artifact to a notebook. Read them to\nfind which Artifact is embedded; keep them in the ``blocks`` list unchanged\nwhen saving notebook content so the embed is not removed.\n\n!!! example\n ```python\n from albert.resources.notebooks import LiveCanvasBlock\n\n notebook = client.notebooks.get_by_id(id=\"NTB123\")\n artifacts = [b for b in notebook.blocks if isinstance(b, LiveCanvasBlock)]\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": "liveCanvas",
"default": "liveCanvas",
"description": "Always [`LIVE_CANVAS`][albert.resources.notebooks.BlockType.LIVE_CANVAS].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/LiveCanvasContent",
"description": "The embedded Artifact reference."
}
},
"title": "LiveCanvasBlock",
"type": "object"
}
Fields:
-
id(str) -
version(datetime | None) -
type(Literal[LIVE_CANVAS]) -
content(LiveCanvasContent)
NotebookSearchItem
Bases: BaseAlbertModel
A block-level notebook search hit.
Returned by
search,
each hit represents a single matching content block rather than a full
notebook. Use
get_by_id
or get_block_by_id
to retrieve full notebook content.
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"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "A block-level notebook search hit.\n\nReturned by\n[`search`][albert.collections.notebooks.NotebookCollection.search],\neach hit represents a single matching content block rather than a full\nnotebook. Use\n[`get_by_id`][albert.collections.notebooks.NotebookCollection.get_by_id]\nor [`get_block_by_id`][albert.collections.notebooks.NotebookCollection.get_block_by_id]\nto retrieve full notebook content.",
"properties": {
"blockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the matching block.",
"title": "Blockid"
},
"notebookId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the notebook containing the matching block (format ``NTB...``).",
"title": "Notebookid"
},
"projectId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The notebook parent entity ID returned by search (often a project, but may be a task or template).",
"title": "Projectid"
},
"blockType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the matching block (for example, ``paragraph``, ``ketcher``, or ``table``).",
"title": "Blocktype"
},
"content": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"description": "The block payload. The shape varies by block type.",
"title": "Content"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The notebook name, when indexed.",
"title": "Name"
},
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The notebook status."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit information for when the notebook was created."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit information for when the notebook was last updated."
}
},
"title": "NotebookSearchItem",
"type": "object"
}
Fields:
-
block_id(str | None) -
notebook_id(NotebookId | None) -
project_id(str | None) -
block_type(str | None) -
content(Any | None) -
name(str | None) -
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None)
notebook_id
notebook_id: NotebookId | None = None
The ID of the notebook containing the matching block (format NTB...).
project_id
project_id: str | None = None
The notebook parent entity ID returned by search (often a project, but may be a task or template).
block_type
block_type: str | None = None
The type of the matching block (for example, paragraph, ketcher, or table).
updated
updated: AuditFields | None = None
Audit information for when the notebook was last updated.
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, Ketcher chemical drawings,
Microsoft Office documents, embedded reports, and embedded Artifacts)
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"
},
"ExcelBlock": {
"description": "A Microsoft Excel workbook embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ExcelBlock\n\n block = ExcelBlock()\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": "msxlsx",
"default": "msxlsx",
"description": "Always [`EXCEL`][albert.resources.notebooks.BlockType.EXCEL].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The Excel workbook details."
}
},
"title": "ExcelBlock",
"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"
},
"LiveCanvasBlock": {
"description": "An Artifact embedded in a notebook.\n\nArtifact blocks are placed by sharing an Artifact to a notebook. Read them to\nfind which Artifact is embedded; keep them in the ``blocks`` list unchanged\nwhen saving notebook content so the embed is not removed.\n\n!!! example\n ```python\n from albert.resources.notebooks import LiveCanvasBlock\n\n notebook = client.notebooks.get_by_id(id=\"NTB123\")\n artifacts = [b for b in notebook.blocks if isinstance(b, LiveCanvasBlock)]\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": "liveCanvas",
"default": "liveCanvas",
"description": "Always [`LIVE_CANVAS`][albert.resources.notebooks.BlockType.LIVE_CANVAS].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/LiveCanvasContent",
"description": "The embedded Artifact reference."
}
},
"title": "LiveCanvasBlock",
"type": "object"
},
"LiveCanvasContent": {
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"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"
},
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"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"
},
"PowerPointBlock": {
"description": "A Microsoft PowerPoint presentation embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import PowerPointBlock\n\n block = PowerPointBlock()\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": "mspptx",
"default": "mspptx",
"description": "Always [`POWERPOINT`][albert.resources.notebooks.BlockType.POWERPOINT].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The PowerPoint presentation details."
}
},
"title": "PowerPointBlock",
"type": "object"
},
"ReportBlock": {
"description": "An Albert report embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import ReportBlock\n\n block = ReportBlock()\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": "report",
"default": "report",
"description": "Always [`REPORT`][albert.resources.notebooks.BlockType.REPORT].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/ReportContent",
"description": "The report block payload."
}
},
"title": "ReportBlock",
"type": "object"
},
"ReportContent": {
"additionalProperties": true,
"description": "The content of a report block.\n\nReport blocks embed an Albert report in a notebook. The API stores the\ncontent as a free-form object, so unknown fields are preserved on the model.",
"properties": {},
"title": "ReportContent",
"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"
},
"WordBlock": {
"description": "A Microsoft Word document embedded in a notebook.\n\n!!! example\n ```python\n from albert.resources.notebooks import WordBlock\n\n block = WordBlock()\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": "msdocx",
"default": "msdocx",
"description": "Always [`WORD`][albert.resources.notebooks.BlockType.WORD].",
"title": "Blocktype",
"type": "string"
},
"content": {
"$ref": "#/$defs/OfficeContent",
"description": "The Word document details."
}
},
"title": "WordBlock",
"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, Ketcher chemical drawings,\nMicrosoft Office documents, embedded reports, and embedded Artifacts)\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",
"liveCanvas": "#/$defs/LiveCanvasBlock",
"msdocx": "#/$defs/WordBlock",
"mspptx": "#/$defs/PowerPointBlock",
"msxlsx": "#/$defs/ExcelBlock",
"paragraph": "#/$defs/ParagraphBlock",
"report": "#/$defs/ReportBlock",
"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"
},
{
"$ref": "#/$defs/WordBlock"
},
{
"$ref": "#/$defs/ExcelBlock"
},
{
"$ref": "#/$defs/PowerPointBlock"
},
{
"$ref": "#/$defs/ReportBlock"
},
{
"$ref": "#/$defs/LiveCanvasBlock"
}
]
},
"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.\nWORD : str\n A Microsoft Word document (wire value ``msdocx``).\nEXCEL : str\n A Microsoft Excel workbook (wire value ``msxlsx``).\nPOWERPOINT : str\n A Microsoft PowerPoint presentation (wire value ``mspptx``).\nREPORT : str\n An embedded Albert report.\nLIVE_CANVAS : str\n An embedded Artifact (wire value ``liveCanvas``).",
"enum": [
"paragraph",
"list",
"header",
"checklist",
"image",
"attaches",
"ketcher",
"table",
"msdocx",
"msxlsx",
"mspptx",
"report",
"liveCanvas"
],
"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"
},
"LiveCanvasContent": {
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"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"
},
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"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"
},
"ReportContent": {
"additionalProperties": true,
"description": "The content of a report block.\n\nReport blocks embed an Albert report in a notebook. The API stores the\ncontent as a free-form object, so unknown fields are preserved on the model.",
"properties": {},
"title": "ReportContent",
"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"
}
},
"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"
},
{
"$ref": "#/$defs/OfficeContent"
},
{
"$ref": "#/$defs/ReportContent"
},
{
"$ref": "#/$defs/LiveCanvasContent"
},
{
"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.\nWORD : str\n A Microsoft Word document (wire value ``msdocx``).\nEXCEL : str\n A Microsoft Excel workbook (wire value ``msxlsx``).\nPOWERPOINT : str\n A Microsoft PowerPoint presentation (wire value ``mspptx``).\nREPORT : str\n An embedded Albert report.\nLIVE_CANVAS : str\n An embedded Artifact (wire value ``liveCanvas``).",
"enum": [
"paragraph",
"list",
"header",
"checklist",
"image",
"attaches",
"ketcher",
"table",
"msdocx",
"msxlsx",
"mspptx",
"report",
"liveCanvas"
],
"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"
},
"LiveCanvasContent": {
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"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"
},
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"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"
},
{
"$ref": "#/$defs/OfficeContent"
},
{
"$ref": "#/$defs/ReportContent"
},
{
"$ref": "#/$defs/LiveCanvasContent"
},
{
"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"
},
"ReportContent": {
"additionalProperties": true,
"description": "The content of a report block.\n\nReport blocks embed an Albert report in a notebook. The API stores the\ncontent as a free-form object, so unknown fields are preserved on the model.",
"properties": {},
"title": "ReportContent",
"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"
}
},
"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.
PostBlockPayload
Bases: BaseAlbertModel
Content and placement for a single new notebook block.
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.\nWORD : str\n A Microsoft Word document (wire value ``msdocx``).\nEXCEL : str\n A Microsoft Excel workbook (wire value ``msxlsx``).\nPOWERPOINT : str\n A Microsoft PowerPoint presentation (wire value ``mspptx``).\nREPORT : str\n An embedded Albert report.\nLIVE_CANVAS : str\n An embedded Artifact (wire value ``liveCanvas``).",
"enum": [
"paragraph",
"list",
"header",
"checklist",
"image",
"attaches",
"ketcher",
"table",
"msdocx",
"msxlsx",
"mspptx",
"report",
"liveCanvas"
],
"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"
},
"LiveCanvasContent": {
"additionalProperties": true,
"description": "The content of an Artifact block.\n\nThe block points at an Artifact; the Artifact's own content is stored and\nversioned separately. Unknown fields are preserved on the model so a\nread-modify-write round trip sends the block back unchanged.",
"properties": {
"canvasId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the embedded Artifact (format ``CNV...``).",
"title": "Canvasid"
},
"shareId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the share that places the Artifact in this notebook.",
"title": "Shareid"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Artifact title shown on the block, when cached.",
"title": "Title"
}
},
"title": "LiveCanvasContent",
"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"
},
"OfficeContent": {
"description": "The content of a Microsoft Office block (Word, Excel, or PowerPoint).\n\nOffice blocks are created with empty content; Albert generates the backing\ndocument and populates ``title`` and ``file_key``.",
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display title of the Office document. Set by Albert when the document is created.",
"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 Office document on Albert. Set by Albert when the document is created.",
"title": "Filekey"
}
},
"title": "OfficeContent",
"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"
},
"ReportContent": {
"additionalProperties": true,
"description": "The content of a report block.\n\nReport blocks embed an Albert report in a notebook. The API stores the\ncontent as a free-form object, so unknown fields are preserved on the model.",
"properties": {},
"title": "ReportContent",
"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": "Content and placement for a single new notebook block.",
"properties": {
"blockType": {
"$ref": "#/$defs/BlockType",
"description": "The type of the block to create."
},
"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"
},
{
"$ref": "#/$defs/OfficeContent"
},
{
"$ref": "#/$defs/ReportContent"
},
{
"$ref": "#/$defs/LiveCanvasContent"
}
],
"description": "The content of the block. Must match ``type``.",
"title": "Content"
},
"previousBlockId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the block the new block should follow.",
"title": "Previousblockid"
}
},
"required": [
"blockType",
"content"
],
"title": "PostBlockPayload",
"type": "object"
}
Fields:
-
type(BlockType) -
content(NotebookContent) -
previous_block_id(str | None)
Validators:
previous_block_id
previous_block_id: str | None = None
The ID of the block the new block should follow.
content_matches_type
content_matches_type() -> PostBlockPayload
Source code in src/albert/resources/notebooks.py
model_dump
Serialize the new block while preserving null content values.
NotebookVersion
Bases: BaseAlbertModel
A saved version of a Notebook.
Returned by
get_versions.
Restore one with
restore_version.
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"
}
},
"description": "A saved version of a [`Notebook`][albert.resources.notebooks.Notebook].\n\nReturned by\n[`get_versions`][albert.collections.notebooks.NotebookCollection.get_versions].\nRestore one with\n[`restore_version`][albert.collections.notebooks.NotebookCollection.restore_version].",
"properties": {
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the saved version.",
"title": "Albertid"
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit information for when the version was saved."
}
},
"title": "NotebookVersion",
"type": "object"
}
Fields:
-
id(str | None) -
created(AuditFields | None)
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"
},
"templateId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the source custom template (format ``CTP...``). Required when copying with\n[`RESTORE_TEMPLATE`][albert.resources.notebooks.NotebookCopyType.RESTORE_TEMPLATE].",
"title": "Templateid"
},
"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) -
template_id(CustomTemplateId | None) -
acl(ACLContainer | NotebookCopyACL | None)
template_id
template_id: CustomTemplateId | None = None
The ID of the source custom template (format CTP...). Required when copying with
RESTORE_TEMPLATE.