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

Attributes:

Name Type Description
ORDERED
UNORDERED

ORDERED

ORDERED = 'ordered'

UNORDERED

UNORDERED = 'unordered'

BlockType

Bases: str, Enum

Attributes:

Name Type Description
PARAGRAPH
LIST
HEADER
CHECKLIST
IMAGE
ATTACHES
KETCHER
TABLE

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

Attributes:

Name Type Description
TEMPLATE
TASK
PROJECT
RESTORE_TEMPLATE
GEN_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

Show JSON schema:
{
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    }
  },
  "title": "BaseBlock",
  "type": "object"
}

Fields:

id

id: str

version

version: datetime | None = None

HeaderContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "level": {
      "enum": [
        1,
        2,
        3
      ],
      "title": "Level",
      "type": "integer"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Text"
    }
  },
  "required": [
    "level",
    "text"
  ],
  "title": "HeaderContent",
  "type": "object"
}

Fields:

level

level: Literal[1, 2, 3]

text

text: str | None

HeaderBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "HeaderContent": {
      "properties": {
        "level": {
          "enum": [
            1,
            2,
            3
          ],
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "header",
      "default": "header",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/HeaderContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "HeaderBlock",
  "type": "object"
}

Fields:

type

content

content: HeaderContent

ParagraphContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Text"
    }
  },
  "required": [
    "text"
  ],
  "title": "ParagraphContent",
  "type": "object"
}

Fields:

text

text: str | None

ParagraphBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "ParagraphContent": {
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "paragraph",
      "default": "paragraph",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/ParagraphContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "ParagraphBlock",
  "type": "object"
}

Fields:

type

content

ChecklistItem

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "checked": {
      "title": "Checked",
      "type": "boolean"
    },
    "text": {
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "checked",
    "text"
  ],
  "title": "ChecklistItem",
  "type": "object"
}

Fields:

checked

checked: bool

text

text: str

ChecklistContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "ChecklistItem": {
      "properties": {
        "checked": {
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    }
  },
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/ChecklistItem"
      },
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "items"
  ],
  "title": "ChecklistContent",
  "type": "object"
}

Fields:

items

ChecklistBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "ChecklistContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "properties": {
        "checked": {
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "checklist",
      "default": "checklist",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/ChecklistContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "ChecklistBlock",
  "type": "object"
}

Fields:

type

content

is_checked

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

Get checked state of a checklist item

Parameters

target_text : str The value/text of a checklist entry.

Returns:

Type Description
bool | None

The checked state of the target entry identified by name.

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

     Parameters
    ----------
    target_text : str
        The value/text of a checklist entry.

    Returns
    -------
    bool | None
        The checked state of the target entry identified by name.
    """
    # 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

Show JSON schema:
{
  "properties": {
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Title"
    },
    "namespace": {
      "default": "result",
      "title": "Namespace",
      "type": "string"
    },
    "fileKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Filekey"
    },
    "mimeType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Mimetype"
    },
    "signedURL": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Signedurl"
    }
  },
  "title": "AttachesContent",
  "type": "object"
}

Fields:

title

title: str | None = None

namespace

namespace: str = 'result'

file_key

file_key: str | None = None

format

format: str | None = None

signed_url

signed_url: str | None = None

AttachesBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "AttachesContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mimetype"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "attaches",
      "default": "attaches",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/AttachesContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "AttachesBlock",
  "type": "object"
}

Fields:

type

content

content: AttachesContent

ImageContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Title"
    },
    "namespace": {
      "default": "result",
      "title": "Namespace",
      "type": "string"
    },
    "stretched": {
      "default": false,
      "title": "Stretched",
      "type": "boolean"
    },
    "withBackground": {
      "default": false,
      "title": "Withbackground",
      "type": "boolean"
    },
    "withBorder": {
      "default": false,
      "title": "Withborder",
      "type": "boolean"
    },
    "fileKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Filekey"
    },
    "signedURL": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Signedurl"
    }
  },
  "title": "ImageContent",
  "type": "object"
}

Fields:

title

title: str | None = None

namespace

namespace: str = 'result'

stretched

stretched: bool = False

with_background

with_background: bool = False

with_border

with_border: bool = False

file_key

file_key: str | None = None

signed_url

signed_url: str | None = None

ImageBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "ImageContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "image",
      "default": "image",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/ImageContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "ImageBlock",
  "type": "object"
}

Fields:

type

type: Literal[IMAGE] = IMAGE

content

content: ImageContent

KetcherContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "synthesisId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Synthesisid"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Id"
    },
    "blockId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Blockid"
    },
    "data": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Data"
    },
    "fileKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Filekey"
    },
    "s3Key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "S3Key"
    },
    "png": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Png"
    },
    "ketcherUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Ketcherurl"
    }
  },
  "title": "KetcherContent",
  "type": "object"
}

Fields:

synthesis_id

synthesis_id: SynthesisId | None = None

name

name: str | None = None

id

id: str | None = None

block_id

block_id: str | None = None

data

data: str | None = None

file_key

file_key: str | None = None

s3_key

s3_key: str | None = None

png

png: str | None = None

ketcher_url

ketcher_url: str | None = None

KetcherBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "KetcherContent": {
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Synthesisid"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Png"
        },
        "ketcherUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ketcherurl"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "ketcher",
      "default": "ketcher",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/KetcherContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "KetcherBlock",
  "type": "object"
}

Fields:

type

content

content: KetcherContent

TableContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "properties": {
    "content": {
      "items": {
        "items": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": "array"
      },
      "title": "Content",
      "type": "array"
    },
    "withHeadings": {
      "default": false,
      "title": "Withheadings",
      "type": "boolean"
    }
  },
  "required": [
    "content"
  ],
  "title": "TableContent",
  "type": "object"
}

Fields:

content

content: list[list[str | None]]

with_headings

with_headings: bool = False

TableBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "TableContent": {
      "properties": {
        "content": {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "title": "Withheadings",
          "type": "boolean"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "table",
      "default": "table",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/TableContent"
    }
  },
  "required": [
    "content"
  ],
  "title": "TableBlock",
  "type": "object"
}

Fields:

type

type: Literal[TABLE] = TABLE

content

content: TableContent

to_df

to_df(*, infer_header: bool = True) -> DataFrame

Convert the TableBlock's content to a pd.DataFrame.

Returns:

Type Description
DataFrame

The block's content as a pd.DataFrame.

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

    Returns
    -------
    DataFrame
        The block's content as a pd.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: BaseModel

Show JSON schema:
{
  "$defs": {
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    }
  },
  "$ref": "#/$defs/NotebookListItem"
}

Fields:

content

content: str | None

items

BulletedListContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    }
  },
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/NotebookListItem"
      },
      "title": "Items",
      "type": "array"
    },
    "style": {
      "const": "unordered",
      "default": "unordered",
      "title": "Style",
      "type": "string"
    }
  },
  "required": [
    "items"
  ],
  "title": "BulletedListContent",
  "type": "object"
}

Fields:

items

style

NumberedListContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    }
  },
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/NotebookListItem"
      },
      "title": "Items",
      "type": "array"
    },
    "style": {
      "const": "ordered",
      "default": "ordered",
      "title": "Style",
      "type": "string"
    }
  },
  "required": [
    "items"
  ],
  "title": "NumberedListContent",
  "type": "object"
}

Fields:

items

style

ListBlock

Bases: BaseBlock

Show JSON schema:
{
  "$defs": {
    "BulletedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    }
  },
  "properties": {
    "albertId": {
      "title": "Albertid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blockType": {
      "const": "list",
      "default": "list",
      "title": "Blocktype",
      "type": "string"
    },
    "content": {
      "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

type: Literal[LIST] = LIST

content

content: ListContent

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLink",
      "type": "object"
    }
  },
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Id"
    },
    "Child": {
      "$ref": "#/$defs/EntityLink"
    }
  },
  "required": [
    "Child"
  ],
  "title": "NotebookLink",
  "type": "object"
}

Fields:

id

id: LinkId | None = None

child

child: EntityLink

Notebook

Bases: BaseResource

Show JSON schema:
{
  "$defs": {
    "AttachesBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "attaches",
          "default": "attaches",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/AttachesContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "AttachesBlock",
      "type": "object"
    },
    "AttachesContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mimetype"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "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": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "checklist",
          "default": "checklist",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ChecklistContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "ChecklistBlock",
      "type": "object"
    },
    "ChecklistContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "properties": {
        "checked": {
          "title": "Checked",
          "type": "boolean"
        },
        "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"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLink",
      "type": "object"
    },
    "HeaderBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "header",
          "default": "header",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/HeaderContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "HeaderBlock",
      "type": "object"
    },
    "HeaderContent": {
      "properties": {
        "level": {
          "enum": [
            1,
            2,
            3
          ],
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "image",
          "default": "image",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ImageContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "ImageBlock",
      "type": "object"
    },
    "ImageContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "ketcher",
          "default": "ketcher",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/KetcherContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "KetcherBlock",
      "type": "object"
    },
    "KetcherContent": {
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Synthesisid"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Png"
        },
        "ketcherUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ketcherurl"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "ListBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "list",
          "default": "list",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "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": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "Child": {
          "$ref": "#/$defs/EntityLink"
        }
      },
      "required": [
        "Child"
      ],
      "title": "NotebookLink",
      "type": "object"
    },
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "paragraph",
          "default": "paragraph",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ParagraphContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "ParagraphBlock",
      "type": "object"
    },
    "ParagraphContent": {
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    },
    "TableBlock": {
      "properties": {
        "albertId": {
          "title": "Albertid",
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "blockType": {
          "const": "table",
          "default": "table",
          "title": "Blocktype",
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/TableContent"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableBlock",
      "type": "object"
    },
    "TableContent": {
      "properties": {
        "content": {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "title": "Withheadings",
          "type": "boolean"
        }
      },
      "required": [
        "content"
      ],
      "title": "TableContent",
      "type": "object"
    }
  },
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Albertid"
    },
    "name": {
      "default": "Untitled Notebook",
      "title": "Name",
      "type": "string"
    },
    "parentId": {
      "title": "Parentid",
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Version"
    },
    "blocks": {
      "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,
      "title": "Links"
    }
  },
  "required": [
    "parentId"
  ],
  "title": "Notebook",
  "type": "object"
}

Fields:

id

id: NotebookId | None = None

name

name: str = 'Untitled Notebook'

parent_id

parent_id: ProjectId | TaskId

version

version: datetime | None = None

blocks

links: list[NotebookLink] | None = None

PutOperation

Bases: str, Enum

Attributes:

Name Type Description
UPDATE
DELETE

UPDATE

UPDATE = 'update'

DELETE

DELETE = 'delete'

PutBlockDatum

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "AttachesContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mimetype"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    },
    "BlockType": {
      "enum": [
        "paragraph",
        "list",
        "header",
        "checklist",
        "image",
        "attaches",
        "ketcher",
        "table"
      ],
      "title": "BlockType",
      "type": "string"
    },
    "BulletedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "properties": {
        "checked": {
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    },
    "HeaderContent": {
      "properties": {
        "level": {
          "enum": [
            1,
            2,
            3
          ],
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherContent": {
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Synthesisid"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Png"
        },
        "ketcherUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ketcherurl"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphContent": {
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "text"
      ],
      "title": "ParagraphContent",
      "type": "object"
    },
    "PutOperation": {
      "enum": [
        "update",
        "delete"
      ],
      "title": "PutOperation",
      "type": "string"
    },
    "TableContent": {
      "properties": {
        "content": {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "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": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "mimeType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mimetype"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "AttachesContent",
      "type": "object"
    },
    "BlockType": {
      "enum": [
        "paragraph",
        "list",
        "header",
        "checklist",
        "image",
        "attaches",
        "ketcher",
        "table"
      ],
      "title": "BlockType",
      "type": "string"
    },
    "BulletedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "unordered",
          "default": "unordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "BulletedListContent",
      "type": "object"
    },
    "ChecklistContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/ChecklistItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "items"
      ],
      "title": "ChecklistContent",
      "type": "object"
    },
    "ChecklistItem": {
      "properties": {
        "checked": {
          "title": "Checked",
          "type": "boolean"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "checked",
        "text"
      ],
      "title": "ChecklistItem",
      "type": "object"
    },
    "HeaderContent": {
      "properties": {
        "level": {
          "enum": [
            1,
            2,
            3
          ],
          "title": "Level",
          "type": "integer"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        }
      },
      "required": [
        "level",
        "text"
      ],
      "title": "HeaderContent",
      "type": "object"
    },
    "ImageContent": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "namespace": {
          "default": "result",
          "title": "Namespace",
          "type": "string"
        },
        "stretched": {
          "default": false,
          "title": "Stretched",
          "type": "boolean"
        },
        "withBackground": {
          "default": false,
          "title": "Withbackground",
          "type": "boolean"
        },
        "withBorder": {
          "default": false,
          "title": "Withborder",
          "type": "boolean"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "signedURL": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signedurl"
        }
      },
      "title": "ImageContent",
      "type": "object"
    },
    "KetcherContent": {
      "properties": {
        "synthesisId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Synthesisid"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Blockid"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        },
        "fileKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Filekey"
        },
        "s3Key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "S3Key"
        },
        "png": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Png"
        },
        "ketcherUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ketcherurl"
        }
      },
      "title": "KetcherContent",
      "type": "object"
    },
    "NotebookListItem": {
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "content"
      ],
      "title": "NotebookListItem",
      "type": "object"
    },
    "NumberedListContent": {
      "properties": {
        "items": {
          "items": {
            "$ref": "#/$defs/NotebookListItem"
          },
          "title": "Items",
          "type": "array"
        },
        "style": {
          "const": "ordered",
          "default": "ordered",
          "title": "Style",
          "type": "string"
        }
      },
      "required": [
        "items"
      ],
      "title": "NumberedListContent",
      "type": "object"
    },
    "ParagraphContent": {
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "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": {
      "enum": [
        "update",
        "delete"
      ],
      "title": "PutOperation",
      "type": "string"
    },
    "TableContent": {
      "properties": {
        "content": {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "array"
          },
          "title": "Content",
          "type": "array"
        },
        "withHeadings": {
          "default": false,
          "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

Bases: BaseResource

Show JSON schema:
{
  "$defs": {
    "ACL": {
      "description": "The Access Control List (ACL) 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": "The fine grain control",
      "enum": [
        "ProjectOwner",
        "ProjectEditor",
        "ProjectViewer",
        "ProjectAllTask",
        "ProjectPropertyTask",
        "InventoryOwner",
        "InventoryViewer",
        "CustomTemplateOwner"
      ],
      "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",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "fgclist": {
      "default": null,
      "items": {
        "$ref": "#/$defs/ACL"
      },
      "title": "Fgclist",
      "type": "array"
    },
    "class": {
      "title": "Class",
      "type": "string"
    }
  },
  "required": [
    "class"
  ],
  "title": "NotebookCopyACL",
  "type": "object"
}

Fields:

  • status (Status | None)
  • created (AuditFields | None)
  • updated (AuditFields | None)
  • fgclist (list[ACL])
  • acl_class (str)

fgclist

fgclist: list[ACL] = None

acl_class

acl_class: str

NotebookCopyInfo

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "ACL": {
      "description": "The Access Control List (ACL) 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": "The fine grain control",
      "enum": [
        "ProjectOwner",
        "ProjectEditor",
        "ProjectViewer",
        "ProjectAllTask",
        "ProjectPropertyTask",
        "InventoryOwner",
        "InventoryViewer",
        "CustomTemplateOwner"
      ],
      "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": {
      "properties": {
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/Status"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "Created": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "Updated": {
          "anyOf": [
            {
              "$ref": "#/$defs/AuditFields"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "fgclist": {
          "default": null,
          "items": {
            "$ref": "#/$defs/ACL"
          },
          "title": "Fgclist",
          "type": "array"
        },
        "class": {
          "title": "Class",
          "type": "string"
        }
      },
      "required": [
        "class"
      ],
      "title": "NotebookCopyACL",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "properties": {
    "id": {
      "title": "Id",
      "type": "string"
    },
    "parentId": {
      "title": "Parentid",
      "type": "string"
    },
    "notebookName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Notebookname"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "acl": {
      "anyOf": [
        {
          "$ref": "#/$defs/NotebookCopyACL"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "id",
    "parentId"
  ],
  "title": "NotebookCopyInfo",
  "type": "object"
}

Fields:

id

parent_id

parent_id: str

notebook_name

notebook_name: str | None = None

name

name: str | None = None

acl

acl: NotebookCopyACL | None = None