Skip to content

Notebooks

albert.resources.notebooks

Attributes:

Name Type Description
ListContent
NotebookBlock
NotebookContent
allowed_notebook_contents

ListContent

ListContent = Annotated[
    NumberedListContent | BulletedListContent,
    Field(discriminator="style"),
]

NotebookBlock

NotebookBlock = Annotated[
    _NotebookBlockUnion, Field(discriminator="type")
]

ListBlockStyle

Bases: str, Enum

The style of a list block.

Attributes:

Name Type Description
ORDERED str

A numbered list.

UNORDERED str

A bulleted list.

ORDERED

ORDERED = 'ordered'

UNORDERED

UNORDERED = 'unordered'

BlockType

Bases: str, Enum

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.

PARAGRAPH

PARAGRAPH = 'paragraph'

LIST

LIST = 'list'

HEADER

HEADER = 'header'

CHECKLIST

CHECKLIST = 'checklist'

IMAGE

IMAGE = 'image'

ATTACHES

ATTACHES = 'attaches'

KETCHER

KETCHER = 'ketcher'

TABLE

TABLE = 'table'

NotebookCopyType

Bases: str, Enum

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.

TEMPLATE

TEMPLATE = 'template'

TASK

TASK = 'Task'

PROJECT

PROJECT = 'Project'

RESTORE_TEMPLATE

RESTORE_TEMPLATE = 'restoreTemplate'

GEN_TASK_TEMPLATE

GEN_TASK_TEMPLATE = 'genTaskTemplate'

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:

id

id: str

The block's unique identifier. Generated automatically (a UUID) if not provided.

version

version: datetime | None = None

The version timestamp of the block, set by Albert.

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:

level

level: int

The heading level (1 is the largest heading).

text

text: str | None

The heading text.

HeaderBlock

Bases: BaseBlock

A section heading in a notebook.

Example

from albert.resources.notebooks import HeaderBlock, HeaderContent

block = HeaderBlock(content=HeaderContent(level=1, text="Procedure"))
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:

type

Always HEADER.

content

content: HeaderContent

The heading level and text.

ParagraphContent

Bases: BaseAlbertModel

The content of a paragraph block.

Show JSON schema:
{
  "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"
}

Fields:

text

text: str | None

The paragraph text.

ParagraphBlock

Bases: BaseBlock

A block of free text in a notebook.

Example

from albert.resources.notebooks import ParagraphBlock, ParagraphContent

block = ParagraphBlock(content=ParagraphContent(text="Weighed 1.2 g."))
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:

content

The paragraph text.

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:

checked

checked: bool

Whether the item is checked.

text

text: str

The item's label text.

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:

items

The checklist entries, in order.

ChecklistBlock

Bases: BaseBlock

A list of checkable items in a notebook.

Example

from albert.resources.notebooks import (
    ChecklistBlock,
    ChecklistContent,
    ChecklistItem,
)

block = ChecklistBlock(
    content=ChecklistContent(
        items=[ChecklistItem(text="Calibrate scale", checked=False)]
    )
)
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:

content

The checklist items.

is_checked

is_checked(*, target_text: str) -> bool | None

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 None if no entry has the given text.

Source code in src/albert/resources/notebooks.py
def is_checked(self, *, target_text: str) -> bool | None:
    """Return the checked state of a checklist item by its text.

    Parameters
    ----------
    target_text : str
        The label text of the checklist entry to look up.

    Returns
    -------
    bool | None
        The checked state of the matching entry, or ``None`` if no entry has
        the given text.
    """
    # loop items
    for i in self.content.items:
        if i.text == target_text:
            # return check state
            return i.checked

    # return None if no match
    return

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

title: str | None = None

The display title of the attachment. Defaults to the file name.

namespace

namespace: str = 'result'

The file storage namespace. Defaults to "result".

file_key

file_key: str | None = None

The storage key of the uploaded file on Albert.

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

file_path: str | Path | None = None

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

from albert.resources.notebooks import AttachesBlock, AttachesContent

block = AttachesBlock(
    content=AttachesContent(file_path="/path/to/spectrum.pdf")
)
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:

type

Always ATTACHES.

content

content: AttachesContent

The attachment details.

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

title: str | None = None

The caption or title of the image.

namespace

namespace: str = 'result'

The file storage namespace. Defaults to "result".

stretched

stretched: bool = False

Whether the image is stretched to full width.

with_background

with_background: bool = False

Whether the image is shown with a background.

with_border

with_border: bool = False

Whether the image is shown with a border.

file_key

file_key: str | None = None

The storage key of the uploaded image on Albert.

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

file_path: str | Path | None = None

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

from albert.resources.notebooks import ImageBlock, ImageContent

block = ImageBlock(content=ImageContent(file_path="/path/to/plot.png"))
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:

type

Always IMAGE.

content

content: ImageContent

The image details.

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

synthesis_id: SynthesisId | None = None

The ID of the synthesis backing the drawing (format SYN...). Set by Albert when the block is created.

id

id: str | None = None

The internal content ID.

block_id

block_id: str | None = None

The ID of the block this content belongs to.

data

data: str | None = None

The raw Ketcher canvas data.

file_key

file_key: str | None = None

The storage key of the rendered structure.

s3_key

s3_key: str | None = None

The storage key of the associated synthesis canvas.

png

png: str | None = None

A PNG rendering of the structure.

state_type

state_type: str = 'project'

The state context of the drawing. Defaults to "project".

smiles

smiles: str | None = None

The SMILES string describing the chemical structure.

KetcherBlock

Bases: BaseBlock

A chemical structure drawn in the Ketcher editor.

Example

from albert.resources.notebooks import KetcherBlock, KetcherContent

block = KetcherBlock(content=KetcherContent(smiles="CCO"))
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:

type

Always KETCHER.

content

content: KetcherContent

The structure details, typically built from a SMILES string.

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:

content

content: list[list[str | None]]

The table cells as a list of rows, each row a list of cell values.

with_headings

with_headings: bool = False

Whether the first row should be treated as column headings.

TableBlock

Bases: BaseBlock

A tabular grid of cells in a notebook.

Example

from albert.resources.notebooks import TableBlock, TableContent

block = TableBlock(
    content=TableContent(
        content=[["Trial", "Yield"], ["1", "82%"]],
        with_headings=True,
    )
)
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:

type

Always TABLE.

content

content: TableContent

The table cells.

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, use the first row as column names (with HTML formatting stripped) and drop it from the data.

True

Returns:

Type Description
DataFrame

The block's content as a pandas DataFrame.

Source code in src/albert/resources/notebooks.py
def to_df(self, *, infer_header: bool = True) -> DataFrame:
    """Convert the table block's content to a pandas DataFrame.

    Parameters
    ----------
    infer_header : bool, default True
        If ``True``, use the first row as column names (with HTML formatting
        stripped) and drop it from the data.

    Returns
    -------
    DataFrame
        The block's content as a pandas DataFrame.
    """

    # convert to df
    df = DataFrame(self.content.content)

    if infer_header:
        # clean df -> column name w/o formatting
        df.columns = df.iloc[0, :]
        df.columns = [re.sub(r"<.*?>", "", x) for x in df.columns]
        # discard first
        df = df.iloc[1:, :].reset_index(drop=True)

    # return df
    return df

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

content: str | None

The item's text.

items

Nested sub-items beneath this entry.

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:

items

The list entries, in order.

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:

items

The list entries, in order.

style

Always ORDERED.

ListBlock

Bases: BaseBlock

A bulleted or numbered list in a notebook.

Example

from albert.resources.notebooks import (
    ListBlock,
    BulletedListContent,
    NotebookListItem,
)

block = ListBlock(
    content=BulletedListContent(
        items=[NotebookListItem(content="First step")]
    )
)
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:

type

Always LIST.

content

content: ListContent

The list entries and style.

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

id: LinkId | None = None

The ID of the link (format LNK...).

child

child: EntityLink

The linked entity.

Notebook

Bases: BaseResource

An electronic lab notebook (ELN) in Albert.

A Notebook is an ordered document of content blocks (paragraphs, headers, checklists, tables, images, attachments, lists, and Ketcher chemical drawings) attached to a parent Project, Task, or custom template. Notebooks are created empty and then populated block-by-block; see NotebookCollection for the workflow.

Example

from albert.resources.notebooks import Notebook

notebook = Notebook(name="Trial 1 log", parent_id="PRO123")
Show JSON schema:
{
  "$defs": {
    "AttachesBlock": {
      "description": "An attached file in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import AttachesBlock, AttachesContent\n\n    block = AttachesBlock(\n        content=AttachesContent(file_path=\"/path/to/spectrum.pdf\")\n    )\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "attaches",
          "default": "attaches",
          "description": "Always [`ATTACHES`][albert.resources.notebooks.BlockType.ATTACHES].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/AttachesContent",
          "description": "The attachment details."
        }
      },
      "required": [
        "content"
      ],
      "title": "AttachesBlock",
      "type": "object"
    },
    "AttachesContent": {
      "description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display title of the attachment. Defaults to the file name.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded file on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local file to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the file, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    },
    "AuditFields": {
      "description": "The audit fields for a resource",
      "properties": {
        "by": {
          "default": null,
          "title": "By",
          "type": "string"
        },
        "byName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Byname"
        },
        "at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "At"
        }
      },
      "title": "AuditFields",
      "type": "object"
    },
    "BulletedListContent": {
      "description": "The content of a bulleted (unordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistBlock": {
      "description": "A list of checkable items in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import (\n        ChecklistBlock,\n        ChecklistContent,\n        ChecklistItem,\n    )\n\n    block = ChecklistBlock(\n        content=ChecklistContent(\n            items=[ChecklistItem(text=\"Calibrate scale\", checked=False)]\n        )\n    )\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "checklist",
          "default": "checklist",
          "description": "Always [`CHECKLIST`][albert.resources.notebooks.BlockType.CHECKLIST].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ChecklistContent",
          "description": "The checklist items."
        }
      },
      "required": [
        "content"
      ],
      "title": "ChecklistBlock",
      "type": "object"
    },
    "ChecklistContent": {
      "description": "The content of a checklist block.",
      "properties": {
        "items": {
          "description": "The checklist entries, in order.",
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "description": "A single entry in a checklist block.",
      "properties": {
        "checked": {
          "description": "Whether the item is checked.",
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "description": "The item's label text.",
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    },
    "EntityLink": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLink",
      "type": "object"
    },
    "HeaderBlock": {
      "description": "A section heading in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import HeaderBlock, HeaderContent\n\n    block = HeaderBlock(content=HeaderContent(level=1, text=\"Procedure\"))\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "header",
          "default": "header",
          "description": "Always [`HEADER`][albert.resources.notebooks.BlockType.HEADER].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/HeaderContent",
          "description": "The heading level and text."
        }
      },
      "required": [
        "content"
      ],
      "title": "HeaderBlock",
      "type": "object"
    },
    "HeaderContent": {
      "description": "The content of a header block.",
      "properties": {
        "level": {
          "description": "The heading level (1 is the largest heading).",
          "minimum": 1,
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The heading text.",
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageBlock": {
      "description": "An embedded image in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import ImageBlock, ImageContent\n\n    block = ImageBlock(content=ImageContent(file_path=\"/path/to/plot.png\"))\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "image",
          "default": "image",
          "description": "Always [`IMAGE`][albert.resources.notebooks.BlockType.IMAGE].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ImageContent",
          "description": "The image details."
        }
      },
      "required": [
        "content"
      ],
      "title": "ImageBlock",
      "type": "object"
    },
    "ImageContent": {
      "description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The caption or title of the image.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "description": "Whether the image is stretched to full width.",
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "description": "Whether the image is shown with a background.",
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "description": "Whether the image is shown with a border.",
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded image on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local image to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the image, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherBlock": {
      "description": "A chemical structure drawn in the Ketcher editor.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import KetcherBlock, KetcherContent\n\n    block = KetcherBlock(content=KetcherContent(smiles=\"CCO\"))\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "ketcher",
          "default": "ketcher",
          "description": "Always [`KETCHER`][albert.resources.notebooks.BlockType.KETCHER].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/KetcherContent",
          "description": "The structure details, typically built from a SMILES string."
        }
      },
      "required": [
        "content"
      ],
      "title": "KetcherBlock",
      "type": "object"
    },
    "KetcherContent": {
      "description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
          "title": "Synthesisid"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The internal content ID.",
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the block this content belongs to.",
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The raw Ketcher canvas data.",
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the rendered structure.",
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the associated synthesis canvas.",
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A PNG rendering of the structure.",
          "title": "Png"
        },
        "stateType": {
          "default": "project",
          "description": "The state context of the drawing. Defaults to ``\"project\"``.",
          "title": "Statetype",
          "type": "string"
        },
        "smiles": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The SMILES string describing the chemical structure.",
          "title": "Smiles"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "ListBlock": {
      "description": "A bulleted or numbered list in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import (\n        ListBlock,\n        BulletedListContent,\n        NotebookListItem,\n    )\n\n    block = ListBlock(\n        content=BulletedListContent(\n            items=[NotebookListItem(content=\"First step\")]\n        )\n    )\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "list",
          "default": "list",
          "description": "Always [`LIST`][albert.resources.notebooks.BlockType.LIST].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "description": "The list entries and style.",
          "discriminator": {
            "mapping": {
              "ordered": "#/$defs/NumberedListContent",
              "unordered": "#/$defs/BulletedListContent"
            },
            "propertyName": "style"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/NumberedListContent"
            },
            {
              "$ref": "#/$defs/BulletedListContent"
            }
          ],
          "title": "Content"
        }
      },
      "required": [
        "content"
      ],
      "title": "ListBlock",
      "type": "object"
    },
    "NotebookLink": {
      "description": "A link from a notebook to another Albert entity.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the link (format ``LNK...``).",
          "title": "Id"
        },
        "Child": {
          "$ref": "#/$defs/EntityLink",
          "description": "The linked entity."
        }
      },
      "required": [
        "Child"
      ],
      "title": "NotebookLink",
      "type": "object"
    },
    "NotebookListItem": {
      "description": "A single entry in a list block, which may itself contain nested entries.",
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The item's text.",
          "title": "Content"
        },
        "items": {
          "description": "Nested sub-items beneath this entry.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "description": "The content of a numbered (ordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphBlock": {
      "description": "A block of free text in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import ParagraphBlock, ParagraphContent\n\n    block = ParagraphBlock(content=ParagraphContent(text=\"Weighed 1.2 g.\"))\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "paragraph",
          "default": "paragraph",
          "description": "Always [`PARAGRAPH`][albert.resources.notebooks.BlockType.PARAGRAPH].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ParagraphContent",
          "description": "The paragraph text."
        }
      },
      "required": [
        "content"
      ],
      "title": "ParagraphBlock",
      "type": "object"
    },
    "ParagraphContent": {
      "description": "The content of a paragraph block.",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The paragraph text.",
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    },
    "TableBlock": {
      "description": "A tabular grid of cells in a notebook.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import TableBlock, TableContent\n\n    block = TableBlock(\n        content=TableContent(\n            content=[[\"Trial\", \"Yield\"], [\"1\", \"82%\"]],\n            with_headings=True,\n        )\n    )\n    ```",
      "properties": {
        "albertId": {
          "description": "The block's unique identifier. Generated automatically (a UUID) if not provided.",
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The version timestamp of the block, set by Albert.",
          "title": "Version"
        },
        "blockType": {
          "const": "table",
          "default": "table",
          "description": "Always [`TABLE`][albert.resources.notebooks.BlockType.TABLE].",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/TableContent",
          "description": "The table cells."
        }
      },
      "required": [
        "content"
      ],
      "title": "TableBlock",
      "type": "object"
    },
    "TableContent": {
      "description": "The content of a table block.",
      "properties": {
        "content": {
          "description": "The table cells as a list of rows, each row a list of cell values.",
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "description": "Whether the first row should be treated as column headings.",
          "title": "Withheadings",
          "type": "boolean"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableContent",
      "type": "object"
    }
  },
  "description": "An electronic lab notebook (ELN) in Albert.\n\nA Notebook is an ordered document of content blocks (paragraphs, headers,\nchecklists, tables, images, attachments, lists, and Ketcher chemical drawings)\nattached to a parent Project, Task, or custom template. Notebooks are created\nempty and then populated block-by-block; see\n[`NotebookCollection`][albert.collections.notebooks.NotebookCollection] for the workflow.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import Notebook\n\n    notebook = Notebook(name=\"Trial 1 log\", parent_id=\"PRO123\")\n    ```",
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the resource, optional."
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the creation of the resource, optional."
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the update of the resource, optional."
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Albert ID of the notebook (format ``NTB...``). Set once the notebook exists on Albert.",
      "title": "Albertid"
    },
    "name": {
      "default": "Untitled Notebook",
      "description": "The notebook's name. Defaults to ``\"Untitled Notebook\"``.",
      "title": "Name",
      "type": "string"
    },
    "parentId": {
      "description": "The entity the notebook is attached to (a Project ``PRO...``, Task ``TAS...``, or custom template ``CTP...``).",
      "title": "Parentid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The version timestamp of the notebook, set by Albert.",
      "title": "Version"
    },
    "blocks": {
      "description": "The ordered content blocks of the notebook.",
      "items": {
        "discriminator": {
          "mapping": {
            "attaches": "#/$defs/AttachesBlock",
            "checklist": "#/$defs/ChecklistBlock",
            "header": "#/$defs/HeaderBlock",
            "image": "#/$defs/ImageBlock",
            "ketcher": "#/$defs/KetcherBlock",
            "list": "#/$defs/ListBlock",
            "paragraph": "#/$defs/ParagraphBlock",
            "table": "#/$defs/TableBlock"
          },
          "propertyName": "blockType"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/HeaderBlock"
          },
          {
            "$ref": "#/$defs/ParagraphBlock"
          },
          {
            "$ref": "#/$defs/ChecklistBlock"
          },
          {
            "$ref": "#/$defs/AttachesBlock"
          },
          {
            "$ref": "#/$defs/ImageBlock"
          },
          {
            "$ref": "#/$defs/KetcherBlock"
          },
          {
            "$ref": "#/$defs/TableBlock"
          },
          {
            "$ref": "#/$defs/ListBlock"
          }
        ]
      },
      "title": "Blocks",
      "type": "array"
    },
    "links": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/NotebookLink"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Links from this notebook to other Albert entities.",
      "title": "Links"
    }
  },
  "required": [
    "parentId"
  ],
  "title": "Notebook",
  "type": "object"
}

Fields:

id

id: NotebookId | None = None

The Albert ID of the notebook (format NTB...). Set once the notebook exists on Albert.

name

name: str = 'Untitled Notebook'

The notebook's name. Defaults to "Untitled Notebook".

parent_id

The entity the notebook is attached to (a Project PRO..., Task TAS..., or custom template CTP...).

version

version: datetime | None = None

The version timestamp of the notebook, set by Albert.

blocks

The ordered content blocks of the notebook.

links: list[NotebookLink] | None = None

Links from this notebook to other Albert entities.

PutOperation

Bases: str, Enum

The operation to apply to a block when saving notebook content.

Attributes:

Name Type Description
UPDATE str

Create or update the block.

DELETE str

Remove the block from the notebook.

UPDATE

UPDATE = 'update'

DELETE

DELETE = 'delete'

PutBlockDatum

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "AttachesContent": {
      "description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display title of the attachment. Defaults to the file name.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded file on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local file to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the file, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    },
    "BlockType": {
      "description": "The type of a notebook content block.\n\nAttributes\n----------\nPARAGRAPH : str\n    A block of free text.\nLIST : str\n    A bulleted or numbered list.\nHEADER : str\n    A section heading.\nCHECKLIST : str\n    A list of checkable items.\nIMAGE : str\n    An embedded image.\nATTACHES : str\n    An attached file.\nKETCHER : str\n    A chemical structure drawn in the Ketcher editor.\nTABLE : str\n    A tabular grid of cells.",
      "enum": [
        "paragraph",
        "list",
        "header",
        "checklist",
        "image",
        "attaches",
        "ketcher",
        "table"
      ],
      "title": "BlockType",
      "type": "string"
    },
    "BulletedListContent": {
      "description": "The content of a bulleted (unordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistContent": {
      "description": "The content of a checklist block.",
      "properties": {
        "items": {
          "description": "The checklist entries, in order.",
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "description": "A single entry in a checklist block.",
      "properties": {
        "checked": {
          "description": "Whether the item is checked.",
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "description": "The item's label text.",
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    },
    "HeaderContent": {
      "description": "The content of a header block.",
      "properties": {
        "level": {
          "description": "The heading level (1 is the largest heading).",
          "minimum": 1,
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The heading text.",
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageContent": {
      "description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The caption or title of the image.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "description": "Whether the image is stretched to full width.",
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "description": "Whether the image is shown with a background.",
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "description": "Whether the image is shown with a border.",
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded image on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local image to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the image, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherContent": {
      "description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
          "title": "Synthesisid"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The internal content ID.",
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the block this content belongs to.",
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The raw Ketcher canvas data.",
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the rendered structure.",
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the associated synthesis canvas.",
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A PNG rendering of the structure.",
          "title": "Png"
        },
        "stateType": {
          "default": "project",
          "description": "The state context of the drawing. Defaults to ``\"project\"``.",
          "title": "Statetype",
          "type": "string"
        },
        "smiles": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The SMILES string describing the chemical structure.",
          "title": "Smiles"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "NotebookListItem": {
      "description": "A single entry in a list block, which may itself contain nested entries.",
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The item's text.",
          "title": "Content"
        },
        "items": {
          "description": "Nested sub-items beneath this entry.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "description": "The content of a numbered (ordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphContent": {
      "description": "The content of a paragraph block.",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The paragraph text.",
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    },
    "PutOperation": {
      "description": "The operation to apply to a block when saving notebook content.\n\nAttributes\n----------\nUPDATE : str\n    Create or update the block.\nDELETE : str\n    Remove the block from the notebook.",
      "enum": [
        "update",
        "delete"
      ],
      "title": "PutOperation",
      "type": "string"
    },
    "TableContent": {
      "description": "The content of a table block.",
      "properties": {
        "content": {
          "description": "The table cells as a list of rows, each row a list of cell values.",
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "description": "Whether the first row should be treated as column headings.",
          "title": "Withheadings",
          "type": "boolean"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableContent",
      "type": "object"
    }
  },
  "properties": {
    "id": {
      "title": "Id",
      "type": "string"
    },
    "operation": {
      "$ref": "#/$defs/PutOperation"
    },
    "blockType": {
      "anyOf": [
        {
          "$ref": "#/$defs/BlockType"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "content": {
      "anyOf": [
        {
          "$ref": "#/$defs/HeaderContent"
        },
        {
          "$ref": "#/$defs/ParagraphContent"
        },
        {
          "$ref": "#/$defs/ChecklistContent"
        },
        {
          "$ref": "#/$defs/AttachesContent"
        },
        {
          "$ref": "#/$defs/ImageContent"
        },
        {
          "$ref": "#/$defs/KetcherContent"
        },
        {
          "$ref": "#/$defs/TableContent"
        },
        {
          "$ref": "#/$defs/BulletedListContent"
        },
        {
          "$ref": "#/$defs/NumberedListContent"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Content"
    },
    "previousBlockId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Previousblockid"
    }
  },
  "required": [
    "id",
    "operation"
  ],
  "title": "PutBlockDatum",
  "type": "object"
}

Fields:

Validators:

id

id: str

operation

operation: PutOperation

type

type: BlockType | None = None

content

content: NotebookContent | None = None

previous_block_id

previous_block_id: str | None = None

content_matches_type

content_matches_type() -> PutBlockDatum
Source code in src/albert/resources/notebooks.py
@model_validator(mode="after")
def content_matches_type(self) -> PutBlockDatum:
    if self.content is None:
        return self  # skip check if there's no content

    content_type = allowed_notebook_contents.get(self.type)
    if content_type and not isinstance(self.content, content_type):
        msg = f"The content type and block type do not match. [content_type={type(self.content)}, block_type={self.type}]"
        raise AlbertException(msg)
    return self

model_dump

model_dump(**kwargs) -> dict[str, Any]

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
def model_dump(self, **kwargs) -> dict[str, Any]:
    """
    Shallow model_dump to exclude None values (None only removed from top level).
    This ensures required attrs are not removed.
    """
    base = super().model_dump(**kwargs)
    return {k: v for k, v in base.items() if v is not None}

PutBlockPayload

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "AttachesContent": {
      "description": "The content of a file attachment block.\n\nProvide either ``file_path`` (a local file to upload) or ``file_key`` (an\nalready-uploaded file) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display title of the attachment. Defaults to the file name.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded file on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the file (e.g. ``\"application/pdf\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local file to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the file, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    },
    "BlockType": {
      "description": "The type of a notebook content block.\n\nAttributes\n----------\nPARAGRAPH : str\n    A block of free text.\nLIST : str\n    A bulleted or numbered list.\nHEADER : str\n    A section heading.\nCHECKLIST : str\n    A list of checkable items.\nIMAGE : str\n    An embedded image.\nATTACHES : str\n    An attached file.\nKETCHER : str\n    A chemical structure drawn in the Ketcher editor.\nTABLE : str\n    A tabular grid of cells.",
      "enum": [
        "paragraph",
        "list",
        "header",
        "checklist",
        "image",
        "attaches",
        "ketcher",
        "table"
      ],
      "title": "BlockType",
      "type": "string"
    },
    "BulletedListContent": {
      "description": "The content of a bulleted (unordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "description": "Always [`UNORDERED`][albert.resources.notebooks.ListBlockStyle.UNORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistContent": {
      "description": "The content of a checklist block.",
      "properties": {
        "items": {
          "description": "The checklist entries, in order.",
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "description": "A single entry in a checklist block.",
      "properties": {
        "checked": {
          "description": "Whether the item is checked.",
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "description": "The item's label text.",
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    },
    "HeaderContent": {
      "description": "The content of a header block.",
      "properties": {
        "level": {
          "description": "The heading level (1 is the largest heading).",
          "minimum": 1,
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The heading text.",
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageContent": {
      "description": "The content of an image block.\n\nProvide either ``file_path`` (a local image to upload) or ``file_key`` (an\nalready-uploaded image) when building the block.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The caption or title of the image.",
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "description": "The file storage namespace. Defaults to ``\"result\"``.",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "description": "Whether the image is stretched to full width.",
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "description": "Whether the image is shown with a background.",
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "description": "Whether the image is shown with a border.",
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the uploaded image on Albert.",
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The MIME type of the image (e.g. ``\"image/png\"``). Inferred from the file name if not set.",
          "title": "Mimetype"
        },
        "file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path to a local image to upload. Not stored on the server.",
          "title": "File Path"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A temporary download URL for the image, populated by Albert. Read-only.",
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherContent": {
      "description": "The content of a Ketcher chemical-structure block.\n\nWhen creating a new Ketcher block, set ``smiles`` to the structure's SMILES\nstring; the remaining fields are populated by Albert. Existing Ketcher blocks\ncannot be edited in place.",
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the synthesis backing the drawing (format ``SYN...``). Set by Albert when the block is created.",
          "title": "Synthesisid"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The internal content ID.",
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the block this content belongs to.",
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The raw Ketcher canvas data.",
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the rendered structure.",
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The storage key of the associated synthesis canvas.",
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A PNG rendering of the structure.",
          "title": "Png"
        },
        "stateType": {
          "default": "project",
          "description": "The state context of the drawing. Defaults to ``\"project\"``.",
          "title": "Statetype",
          "type": "string"
        },
        "smiles": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The SMILES string describing the chemical structure.",
          "title": "Smiles"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "NotebookListItem": {
      "description": "A single entry in a list block, which may itself contain nested entries.",
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The item's text.",
          "title": "Content"
        },
        "items": {
          "description": "Nested sub-items beneath this entry.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "description": "The content of a numbered (ordered) list block.",
      "properties": {
        "items": {
          "description": "The list entries, in order.",
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "description": "Always [`ORDERED`][albert.resources.notebooks.ListBlockStyle.ORDERED].",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphContent": {
      "description": "The content of a paragraph block.",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The paragraph text.",
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    },
    "PutBlockDatum": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "operation": {
          "$ref": "#/$defs/PutOperation"
        },
        "blockType": {
          "anyOf": [
            {
              "$ref": "#/$defs/BlockType"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "content": {
          "anyOf": [
            {
              "$ref": "#/$defs/HeaderContent"
            },
            {
              "$ref": "#/$defs/ParagraphContent"
            },
            {
              "$ref": "#/$defs/ChecklistContent"
            },
            {
              "$ref": "#/$defs/AttachesContent"
            },
            {
              "$ref": "#/$defs/ImageContent"
            },
            {
              "$ref": "#/$defs/KetcherContent"
            },
            {
              "$ref": "#/$defs/TableContent"
            },
            {
              "$ref": "#/$defs/BulletedListContent"
            },
            {
              "$ref": "#/$defs/NumberedListContent"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "previousBlockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Previousblockid"
        }
      },
      "required": [
        "id",
        "operation"
      ],
      "title": "PutBlockDatum",
      "type": "object"
    },
    "PutOperation": {
      "description": "The operation to apply to a block when saving notebook content.\n\nAttributes\n----------\nUPDATE : str\n    Create or update the block.\nDELETE : str\n    Remove the block from the notebook.",
      "enum": [
        "update",
        "delete"
      ],
      "title": "PutOperation",
      "type": "string"
    },
    "TableContent": {
      "description": "The content of a table block.",
      "properties": {
        "content": {
          "description": "The table cells as a list of rows, each row a list of cell values.",
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "description": "Whether the first row should be treated as column headings.",
          "title": "Withheadings",
          "type": "boolean"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableContent",
      "type": "object"
    }
  },
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/PutBlockDatum"
      },
      "title": "Data",
      "type": "array"
    }
  },
  "required": [
    "data"
  ],
  "title": "PutBlockPayload",
  "type": "object"
}

Fields:

data

model_dump

model_dump(**kwargs) -> dict[str, Any]

model_dump to ensure only top-level None attrs are removed on PutBlockDatum.

Source code in src/albert/resources/notebooks.py
def model_dump(self, **kwargs) -> dict[str, Any]:
    """model_dump to ensure only top-level None attrs are removed on PutBlockDatum."""
    return {"data": [item.model_dump(**kwargs) for item in self.data]}

NotebookCopyACL

NotebookCopyACL(**data)

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:

Source code in src/albert/resources/notebooks.py
def __init__(self, **data):
    warnings.warn(
        "NotebookCopyACL is deprecated and will be removed in 2.0; use ACLContainer instead.",
        DeprecationWarning,
        stacklevel=2,
    )
    super().__init__(**data)

fgclist

fgclist: list[ACL] = None

Specific access rules for users or teams.

acl_class

acl_class: str

Default access class (for example, "restricted" or "confidential").

NotebookCopyInfo

Bases: BaseAlbertModel

Instructions for copying a notebook into a new parent.

Example

from albert.resources.notebooks import NotebookCopyInfo

info = NotebookCopyInfo(id="NTB123", parent_id="PRO456")
Show JSON schema:
{
  "$defs": {
    "ACL": {
      "description": "A single access rule for a user.",
      "properties": {
        "id": {
          "description": "The id of the user for which this ACL applies",
          "title": "Id",
          "type": "string"
        },
        "fgc": {
          "anyOf": [
            {
              "$ref": "#/$defs/AccessControlLevel"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The Fine-Grain Control Level"
        }
      },
      "required": [
        "id"
      ],
      "title": "ACL",
      "type": "object"
    },
    "ACLContainer": {
      "description": "Access settings with a default class and a list of rules.",
      "properties": {
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/Status"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the resource, optional."
        },
        "Created": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Audit fields for the creation of the resource, optional."
        },
        "Updated": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Audit fields for the update of the resource, optional."
        },
        "class": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default access class (for example, \"restricted\" or \"confidential\").",
          "title": "Class"
        },
        "fgclist": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ACL"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Specific access rules for users or teams.",
          "title": "Fgclist"
        }
      },
      "title": "ACLContainer",
      "type": "object"
    },
    "AccessControlLevel": {
      "description": "Access control levels you can grant users.",
      "enum": [
        "ProjectOwner",
        "ProjectEditor",
        "ProjectViewer",
        "ProjectAllTask",
        "ProjectStrictViewer",
        "ProjectPropertyTask",
        "InventoryOwner",
        "InventoryViewer",
        "CustomTemplateOwner",
        "CustomTemplateViewer",
        "CASFullAccess"
      ],
      "title": "AccessControlLevel",
      "type": "string"
    },
    "AuditFields": {
      "description": "The audit fields for a resource",
      "properties": {
        "by": {
          "default": null,
          "title": "By",
          "type": "string"
        },
        "byName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Byname"
        },
        "at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "At"
        }
      },
      "title": "AuditFields",
      "type": "object"
    },
    "NotebookCopyACL": {
      "description": "Access settings applied to a copied notebook.\n\nWarning\n-----\nDeprecated and will be removed in 2.0. Use ``ACLContainer`` instead.",
      "properties": {
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/Status"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the resource, optional."
        },
        "Created": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Audit fields for the creation of the resource, optional."
        },
        "Updated": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Audit fields for the update of the resource, optional."
        },
        "fgclist": {
          "default": null,
          "description": "Specific access rules for users or teams.",
          "items": {
            "$ref": "#/$defs/ACL"
          },
          "title": "Fgclist",
          "type": "array"
        },
        "class": {
          "description": "Default access class (for example, \"restricted\" or \"confidential\").",
          "title": "Class",
          "type": "string"
        }
      },
      "required": [
        "class"
      ],
      "title": "NotebookCopyACL",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "description": "Instructions for copying a notebook into a new parent.\n\n!!! example\n    ```python\n    from albert.resources.notebooks import NotebookCopyInfo\n\n    info = NotebookCopyInfo(id=\"NTB123\", parent_id=\"PRO456\")\n    ```",
  "properties": {
    "id": {
      "description": "The ID of the source notebook to copy (format ``NTB...``).",
      "title": "Id",
      "type": "string"
    },
    "parentId": {
      "description": "The ID of the destination parent to copy the notebook into.",
      "title": "Parentid",
      "type": "string"
    },
    "notebookName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The name to give the copied notebook.",
      "title": "Notebookname"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "An optional alternative name for the copy.",
      "title": "Name"
    },
    "acl": {
      "anyOf": [
        {
          "$ref": "#/$defs/ACLContainer"
        },
        {
          "$ref": "#/$defs/NotebookCopyACL"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Access-control settings to apply to the copy.",
      "title": "Acl"
    }
  },
  "required": [
    "id",
    "parentId"
  ],
  "title": "NotebookCopyInfo",
  "type": "object"
}

Fields:

id

The ID of the source notebook to copy (format NTB...).

parent_id

parent_id: str

The ID of the destination parent to copy the notebook into.

notebook_name

notebook_name: str | None = None

The name to give the copied notebook.

name

name: str | None = None

An optional alternative name for the copy.

acl

acl: ACLContainer | NotebookCopyACL | None = None

Access-control settings to apply to the copy.