{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "api",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Python API for working with notebook files"
        }
      ],
      "level": 0,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The reading functions require you to pass the "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "as_version"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter. Your code should specify the notebook format that it knows how to work with: for instance, if your code handles version 4 notebooks      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "nb = nbformat.read('path/to/notebook.ipynb', as_version=4)",
          "execution_status": null,
          "out": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This will automatically upgrade or downgrade notebooks in other versions of the notebook format to the structure your code knows about."
            }
          ]
        },
        {
          "__type": "Blockquote",
          "__tag": 4059,
          "children": [
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "These integers represent the current notebook format version that the    nbformat module knows about."
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Reading and writing"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The functions in this module work with "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "NotebookNode",
              "domain": null,
              "role": "class",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " objects, which are like dictionaries, but allow attribute access ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "nb.cells"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "). The structure of these objects matches the notebook format described in "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "The Notebook file format",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "format_description"
              },
              "kind": "docs"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "NotebookNode objects"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Other functions"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "These functions return "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "NotebookNode",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "nbformat",
                "version": "?",
                "kind": "module",
                "path": "nbformat.notebooknode:NotebookNode"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " objects with the necessary fields."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Constructing notebooks programmatically"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This machinery is used by the notebook web application to record which notebooks are "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "trusted"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and may show dynamic output as soon as they're loaded. See "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "jupyter-server:server_security",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for more information."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Notebook signatures"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Signatures are stored using a pluggable "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "SignatureStore",
              "domain": null,
              "role": "class",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " subclass. To implement your own, override the methods below and configure "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "NotebookNotary.store_factory"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "By default, "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "NotebookNotary",
              "domain": null,
              "role": "class",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " will use an SQLite based store if SQLite bindings are available, and an in-memory store otherwise."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Signature storage"
        }
      ],
      "level": 2,
      "target": "pluggable_signature_store"
    }
  ],
  "local_refs": []
}