Modifier

Partager via


Notebook definition

This article provides a breakdown of the definition structure for notebook items.

Supported formats

Notebook items support the ipynb format.

Definition parts

The definition of a notebook item is made out of a single part, and is constructed as follows:

Platfrom part

The platform part is a file that contains the notebook metadata information.

  • Create Item with definition respects the platform file if provided. Pronot mandatory)

  • Get Item definition always returns the platform file.

  • Update Item definition accepts the platform file if provided, but only if you set a new URL parameter updateMetadata=true.

Example of payload content decoded from Base64

{
    "nbformat": 4,
    "nbformat_minor": 5,
    "cells": [
        {
            "cell_type": "code",
            "source": ["# Welcome to your new notebook\n# Type here in the cell editor to add code!\n"],
            "execution_count": null,
            "outputs": [],
            "metadata": {}
        }
    ],
    "metadata": {
        "language_info": {
            "name": "python"
        }
    }
}

Definition example

{
    "format": "ipynb",
    "parts": [
        {
            "path": "artifact.content.ipynb",
            "payload": "eyJuYmZvcm1hdCI6NCwibmJmb3JtYXR_fbWlub3IiOjUsImNlbGxzIjpbeyJjZWxsX3R5cGUiOiJjb2RlIiwic291cmNlIjpbIiMgV2VsY29tZSB0byB5b3VyIG5ldyBub3RlYm9va1xuIyBUeXBlIGhlcmUgaW4gdGhlIGNlbGwgZWRpdG9yIHRvIGFkZCBjb2RlIVxuIl0sImV4ZWN1dGlvbl9jb3VudCI6bnVsbCwib3V0cHV0cyI6W10sIm1ldGFkYXRhIjp7fX1dLCJtZXRhZGF0YSI6eyJsYW5ndWFnZV9pbmZvIjp7Im5hbWUiOiJweXRob24ifX19",
            "payloadType": "InlineBase64"
        },
        {
            "path": ".platform",
            "payload": "ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc=",
            "payloadType": "InlineBase64"
        }
    ]
}