master
/ .localenv / lib / python3.5 / site-packages / nbformat / v4 / nbformat.v4.schema.json

nbformat.v4.schema.json @master raw · history · blame

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Jupyter Notebook v4.2 JSON schema.",
    "type": "object",
    "additionalProperties": false,
    "required": ["metadata", "nbformat_minor", "nbformat", "cells"],
    "properties": {
        "metadata": {
            "description": "Notebook root-level metadata.",
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "kernelspec": {
                    "description": "Kernel information.",
                    "type": "object",
                    "required": ["name", "display_name"],
                    "properties": {
                        "name": {
                            "description": "Name of the kernel specification.",
                            "type": "string"
                        },
                        "display_name": {
                            "description": "Name to display in UI.",
                            "type": "string"
                        }
                    }
                },
                "language_info": {
                  "description": "Kernel information.",
                  "type": "object",
                  "required": ["name"],
                  "properties": {
                    "name": {
                        "description": "The programming language which this kernel runs.",
                        "type": "string"
                    },
                    "codemirror_mode": {
                        "description": "The codemirror mode to use for code in this language.",
                        "oneOf": [
                          {"type": "string"},
                          {"type": "object"}
                        ]
                    },
                    "file_extension": {
                        "description": "The file extension for files in this language.",
                        "type": "string"
                    },
                    "mimetype": {
                        "description": "The mimetype corresponding to files in this language.",
                        "type": "string"
                    },
                    "pygments_lexer": {
                        "description": "The pygments lexer to use for code in this language.",
                        "type": "string"
                    }
                  }
                },
                "orig_nbformat": {
                    "description": "Original notebook format (major number) before converting the notebook between versions. This should never be written to a file.",
                    "type": "integer",
                    "minimum": 1
                },
                "title": {
                    "description": "The title of the notebook document",
                    "type": "string"
                },
                "authors": {
                    "description": "The author(s) of the notebook document",
                    "type": "array",
                    "item": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true
                    }
                }
            }
        },
        "nbformat_minor": {
            "description": "Notebook format (minor number). Incremented for backward compatible changes to the notebook format.",
            "type": "integer",
            "minimum": 0
        },
        "nbformat": {
            "description": "Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.",
            "type": "integer",
            "minimum": 4,
            "maximum": 4
        },
        "cells": {
            "description": "Array of cells of the current notebook.",
            "type": "array",
            "items": {"$ref": "#/definitions/cell"}
        }
    },

    "definitions": {
        "cell": {
            "type": "object",
            "oneOf": [
                {"$ref": "#/definitions/raw_cell"},
                {"$ref": "#/definitions/markdown_cell"},
                {"$ref": "#/definitions/code_cell"}
            ]
        },

        "raw_cell": {
            "description": "Notebook raw nbconvert cell.",
            "type": "object",
            "additionalProperties": false,
            "required": ["cell_type", "metadata", "source"],
            "properties": {
                "cell_type": {
                    "description": "String identifying the type of cell.",
                    "enum": ["raw"]
                },
                "metadata": {
                    "description": "Cell-level metadata.",
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                        "format": {
                            "description": "Raw cell metadata format for nbconvert.",
                            "type": "string"
                        },
                        "jupyter": {
                          "description": "Official Jupyter Metadata for Raw Cells",
                          "type": "object",
                          "additionalProperties": true,
                            "source_hidden": {
                                "description": "Whether the source is hidden.",
                                "type": "boolean"
                            }
                        },
                        "name": {"$ref": "#/definitions/misc/metadata_name"},
                        "tags": {"$ref": "#/definitions/misc/metadata_tags"}
                    }
                },
                "attachments": {"$ref": "#/definitions/misc/attachments"},
                "source": {"$ref": "#/definitions/misc/source"}
            }
        },

        "markdown_cell": {
            "description": "Notebook markdown cell.",
            "type": "object",
            "additionalProperties": false,
            "required": ["cell_type", "metadata", "source"],
            "properties": {
                "cell_type": {
                    "description": "String identifying the type of cell.",
                    "enum": ["markdown"]
                },
                "metadata": {
                    "description": "Cell-level metadata.",
                    "type": "object",
                    "properties": {
                        "name": {"$ref": "#/definitions/misc/metadata_name"},
                        "tags": {"$ref": "#/definitions/misc/metadata_tags"},
                        "jupyter": {
                          "description": "Official Jupyter Metadata for Markdown Cells",
                          "type": "object",
                          "additionalProperties": true,
                            "source_hidden": {
                                "description": "Whether the source is hidden.",
                                "type": "boolean"
                            }
                        }
                    },
                    "additionalProperties": true
                },
                "attachments": {"$ref": "#/definitions/misc/attachments"},
                "source": {"$ref": "#/definitions/misc/source"}
            }
        },

        "code_cell": {
            "description": "Notebook code cell.",
            "type": "object",
            "additionalProperties": false,
            "required": ["cell_type", "metadata", "source", "outputs", "execution_count"],
            "properties": {
                "cell_type": {
                    "description": "String identifying the type of cell.",
                    "enum": ["code"]
                },
                "metadata": {
                    "description": "Cell-level metadata.",
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                        "jupyter": {
                          "description": "Official Jupyter Metadata for Code Cells",
                          "type": "object",
                          "additionalProperties": true,
                            "source_hidden": {
                                "description": "Whether the source is hidden.",
                                "type": "boolean"
                            },
                            "outputs_hidden": {
                                "description": "Whether the outputs are hidden.",
                                "type": "boolean"
                            }
                        },
                        "collapsed": {
                            "description": "Whether the cell is collapsed/expanded.",
                            "type": "boolean"
                        },
                        "scrolled": {
                            "description": "Whether the cell's output is scrolled, unscrolled, or autoscrolled.",
                            "enum": [true, false, "auto"]
                        },
                        "name": {"$ref": "#/definitions/misc/metadata_name"},
                        "tags": {"$ref": "#/definitions/misc/metadata_tags"}
                    }
                },
                "source": {"$ref": "#/definitions/misc/source"},
                "outputs": {
                    "description": "Execution, display, or stream outputs.",
                    "type": "array",
                    "items": {"$ref": "#/definitions/output"}
                },
                "execution_count": {
                    "description": "The code cell's prompt number. Will be null if the cell has not been run.",
                    "type": ["integer", "null"],
                    "minimum": 0
                }
            }
        },

        "unrecognized_cell": {
            "description": "Unrecognized cell from a future minor-revision to the notebook format.",
            "type": "object",
            "additionalProperties": true,
            "required": ["cell_type", "metadata"],
            "properties": {
                "cell_type": {
                    "description": "String identifying the type of cell.",
                    "not" : {
                      "enum": ["markdown", "code", "raw"]
                    }
                },
                "metadata": {
                    "description": "Cell-level metadata.",
                    "type": "object",
                    "properties": {
                        "name": {"$ref": "#/definitions/misc/metadata_name"},
                        "tags": {"$ref": "#/definitions/misc/metadata_tags"}
                    },
                    "additionalProperties": true
                }
            }
        },

        "output": {
            "type": "object",
            "oneOf": [
                {"$ref": "#/definitions/execute_result"},
                {"$ref": "#/definitions/display_data"},
                {"$ref": "#/definitions/stream"},
                {"$ref": "#/definitions/error"}
            ]
        },

        "execute_result": {
            "description": "Result of executing a code cell.",
            "type": "object",
            "additionalProperties": false,
            "required": ["output_type", "data", "metadata", "execution_count"],
            "properties": {
                "output_type": {
                    "description": "Type of cell output.",
                    "enum": ["execute_result"]
                },
                "execution_count": {
                    "description": "A result's prompt number.",
                    "type": ["integer", "null"],
                    "minimum": 0
                },
                "data": {"$ref": "#/definitions/misc/mimebundle"},
                "metadata": {"$ref": "#/definitions/misc/output_metadata"}
            }
        },

        "display_data": {
            "description": "Data displayed as a result of code cell execution.",
            "type": "object",
            "additionalProperties": false,
            "required": ["output_type", "data", "metadata"],
            "properties": {
                "output_type": {
                    "description": "Type of cell output.",
                    "enum": ["display_data"]
                },
                "data": {"$ref": "#/definitions/misc/mimebundle"},
                "metadata": {"$ref": "#/definitions/misc/output_metadata"}
            }
        },

        "stream": {
            "description": "Stream output from a code cell.",
            "type": "object",
            "additionalProperties": false,
            "required": ["output_type", "name", "text"],
            "properties": {
                "output_type": {
                    "description": "Type of cell output.",
                    "enum": ["stream"]
                },
                "name": {
                    "description": "The name of the stream (stdout, stderr).",
                    "type": "string"
                },
                "text": {
                    "description": "The stream's text output, represented as an array of strings.",
                    "$ref": "#/definitions/misc/multiline_string"
                }
            }
        },

        "error": {
            "description": "Output of an error that occurred during code cell execution.",
            "type": "object",
            "additionalProperties": false,
            "required": ["output_type", "ename", "evalue", "traceback"],
            "properties": {
                "output_type": {
                    "description": "Type of cell output.",
                    "enum": ["error"]
                },
                "ename": {
                    "description": "The name of the error.",
                    "type": "string"
                },
                "evalue": {
                    "description": "The value, or message, of the error.",
                    "type": "string"
                },
                "traceback": {
                    "description": "The error's traceback, represented as an array of strings.",
                    "type": "array",
                    "items": {"type": "string"}
                }
            }
        },

        "unrecognized_output": {
            "description": "Unrecognized output from a future minor-revision to the notebook format.",
            "type": "object",
            "additionalProperties": true,
            "required": ["output_type"],
            "properties": {
                "output_type": {
                    "description": "Type of cell output.",
                    "not": {
                        "enum": ["execute_result", "display_data", "stream", "error"]
                    }
                }
            }
        },

        "misc": {
            "metadata_name": {
                "description": "The cell's name. If present, must be a non-empty string. Must be unique across all the cells of a given notebook.",
                "type": "string",
                "pattern": "^.+$"
            },
            "metadata_tags": {
                "description": "The cell's tags. Tags must be unique, and must not contain commas.",
                "type": "array",
                "uniqueItems": true,
                "items": {
                    "type": "string",
                    "pattern": "^[^,]+$"
                }
            },
            "attachments": {
                "description": "Media attachments (e.g. inline images), stored as mimebundle keyed by filename.",
                "type": "object",
                "patternProperties": {
                    ".*": {
                        "description": "The attachment's data stored as a mimebundle.",
                        "$ref": "#/definitions/misc/mimebundle"
                    }
                }
            },
            "source": {
                "description": "Contents of the cell, represented as an array of lines.",
                "$ref": "#/definitions/misc/multiline_string"
            },
            "execution_count": {
                "description": "The code cell's prompt number. Will be null if the cell has not been run.",
                "type": ["integer", "null"],
                "minimum": 0
            },
            "mimebundle": {
                "description": "A mime-type keyed dictionary of data",
                "type": "object",
                "additionalProperties": {
                  "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
                  "$ref": "#/definitions/misc/multiline_string"
                },
                "patternProperties": {
                    "^application/(.*\\+)?json$": {
                        "description": "Mimetypes with JSON output, can be any type"
                    }
                }
            },
            "output_metadata": {
                "description": "Cell output metadata.",
                "type": "object",
                "additionalProperties": true
            },
            "multiline_string": {
                "oneOf" : [
                    {"type": "string"},
                    {
                        "type": "array",
                        "items": {"type": "string"}
                    }
                ]
            }
        }
    }
}