Show More
@@ -1,363 +1,363 b'' | |||
|
1 | 1 | { |
|
2 | 2 | "$schema": "http://json-schema.org/draft-04/schema#", |
|
3 | 3 | "description": "IPython Notebook v3.0 JSON schema.", |
|
4 | 4 | "type": "object", |
|
5 | 5 | "additionalProperties": false, |
|
6 | 6 | "required": ["metadata", "nbformat_minor", "nbformat", "worksheets"], |
|
7 | 7 | "properties": { |
|
8 | 8 | "metadata": { |
|
9 | 9 | "description": "Notebook root-level metadata.", |
|
10 | 10 | "type": "object", |
|
11 | 11 | "additionalProperties": true, |
|
12 | 12 | "properties": { |
|
13 | 13 | "kernel_info": { |
|
14 | 14 | "description": "Kernel information.", |
|
15 | 15 | "type": "object", |
|
16 | 16 | "required": ["name", "language"], |
|
17 | 17 | "properties": { |
|
18 | 18 | "name": { |
|
19 | 19 | "description": "Name of the kernel specification.", |
|
20 | 20 | "type": "string" |
|
21 | 21 | }, |
|
22 | 22 | "language": { |
|
23 | 23 | "description": "The programming language which this kernel runs.", |
|
24 | 24 | "type": "string" |
|
25 | 25 | }, |
|
26 | 26 | "codemirror_mode": { |
|
27 | 27 | "description": "The codemirror mode to use for code in this language.", |
|
28 | 28 | "type": "string" |
|
29 | 29 | } |
|
30 | 30 | } |
|
31 | 31 | }, |
|
32 | 32 | "signature": { |
|
33 | 33 | "description": "Hash of the notebook.", |
|
34 | 34 | "type": "string" |
|
35 | 35 | } |
|
36 | 36 | } |
|
37 | 37 | }, |
|
38 | 38 | "nbformat_minor": { |
|
39 | 39 | "description": "Notebook format (minor number). Incremented for backward compatible changes to the notebook format.", |
|
40 | 40 | "type": "integer", |
|
41 | 41 | "minimum": 0 |
|
42 | 42 | }, |
|
43 | 43 | "nbformat": { |
|
44 | 44 | "description": "Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.", |
|
45 | 45 | "type": "integer", |
|
46 | 46 | "minimum": 3, |
|
47 | 47 | "maximum": 3 |
|
48 | 48 | }, |
|
49 | 49 | "orig_nbformat": { |
|
50 | 50 | "description": "Original notebook format (major number) before converting the notebook between versions.", |
|
51 | 51 | "type": "integer", |
|
52 | 52 | "minimum": 1 |
|
53 | 53 | }, |
|
54 | 54 | "worksheets" : { |
|
55 | 55 | "description": "Array of worksheets", |
|
56 | 56 | "type": "array", |
|
57 | 57 | "items": {"$ref": "#/definitions/worksheet"} |
|
58 | 58 | } |
|
59 | 59 | }, |
|
60 | 60 | |
|
61 | 61 | "definitions": { |
|
62 | 62 | "worksheet": { |
|
63 | 63 | "additionalProperties": false, |
|
64 | 64 | "required" : ["cells"], |
|
65 | 65 | "properties":{ |
|
66 | 66 | "cells": { |
|
67 | 67 | "description": "Array of cells of the current notebook.", |
|
68 | 68 | "type": "array", |
|
69 | 69 | "items": { |
|
70 | 70 | "type": "object", |
|
71 | 71 | "oneOf": [ |
|
72 | 72 | {"$ref": "#/definitions/raw_cell"}, |
|
73 | 73 | {"$ref": "#/definitions/markdown_cell"}, |
|
74 | 74 | {"$ref": "#/definitions/heading_cell"}, |
|
75 | 75 | {"$ref": "#/definitions/code_cell"} |
|
76 | 76 | ] |
|
77 | 77 | } |
|
78 | 78 | }, |
|
79 | 79 | "metadata": { |
|
80 | 80 | "type": "object", |
|
81 | 81 | "description": "metadata of the current worksheet" |
|
82 | 82 | } |
|
83 | 83 | } |
|
84 | 84 | }, |
|
85 | 85 | "raw_cell": { |
|
86 | 86 | "description": "Notebook raw nbconvert cell.", |
|
87 | 87 | "type": "object", |
|
88 | 88 | "additionalProperties": false, |
|
89 | 89 | "required": ["cell_type", "source"], |
|
90 | 90 | "properties": { |
|
91 | 91 | "cell_type": { |
|
92 | 92 | "description": "String identifying the type of cell.", |
|
93 | 93 | "enum": ["raw"] |
|
94 | 94 | }, |
|
95 | 95 | "metadata": { |
|
96 | 96 | "description": "Cell-level metadata.", |
|
97 | 97 | "type": "object", |
|
98 | 98 | "additionalProperties": true, |
|
99 | 99 | "properties": { |
|
100 | 100 | "format": { |
|
101 | 101 | "description": "Raw cell metadata format for nbconvert.", |
|
102 | 102 | "type": "string" |
|
103 | 103 | }, |
|
104 | 104 | "name": {"$ref": "#/definitions/misc/metadata_name"}, |
|
105 | 105 | "tags": {"$ref": "#/definitions/misc/metadata_tags"} |
|
106 | 106 | } |
|
107 | 107 | }, |
|
108 | 108 | "source": {"$ref": "#/definitions/misc/source"} |
|
109 | 109 | } |
|
110 | 110 | }, |
|
111 | 111 | |
|
112 | 112 | "markdown_cell": { |
|
113 | 113 | "description": "Notebook markdown cell.", |
|
114 | 114 | "type": "object", |
|
115 | 115 | "additionalProperties": false, |
|
116 | 116 | "required": ["cell_type", "source"], |
|
117 | 117 | "properties": { |
|
118 | 118 | "cell_type": { |
|
119 | 119 | "description": "String identifying the type of cell.", |
|
120 | 120 | "enum": ["markdown", "html"] |
|
121 | 121 | }, |
|
122 | 122 | "metadata": { |
|
123 | 123 | "description": "Cell-level metadata.", |
|
124 | 124 | "type": "object", |
|
125 | 125 | "properties": { |
|
126 | 126 | "name": {"$ref": "#/definitions/misc/metadata_name"}, |
|
127 | 127 | "tags": {"$ref": "#/definitions/misc/metadata_tags"} |
|
128 | 128 | }, |
|
129 | 129 | "additionalProperties": true |
|
130 | 130 | }, |
|
131 | 131 | "source": {"$ref": "#/definitions/misc/source"} |
|
132 | 132 | } |
|
133 | 133 | }, |
|
134 | 134 | |
|
135 | 135 | "heading_cell": { |
|
136 | 136 | "description": "Notebook heading cell.", |
|
137 | 137 | "type": "object", |
|
138 | 138 | "additionalProperties": false, |
|
139 | 139 | "required": ["cell_type", "source", "level"], |
|
140 | 140 | "properties": { |
|
141 | 141 | "cell_type": { |
|
142 | 142 | "description": "String identifying the type of cell.", |
|
143 | 143 | "enum": ["heading"] |
|
144 | 144 | }, |
|
145 | 145 | "metadata": { |
|
146 | 146 | "description": "Cell-level metadata.", |
|
147 | 147 | "type": "object", |
|
148 | 148 | "additionalProperties": true |
|
149 | 149 | }, |
|
150 | 150 | "source": {"$ref": "#/definitions/misc/source"}, |
|
151 | 151 | "level": { |
|
152 | 152 | "description": "Level of heading cells.", |
|
153 | 153 | "type": "integer", |
|
154 | 154 | "minimum": 1 |
|
155 | 155 | } |
|
156 | 156 | } |
|
157 | 157 | }, |
|
158 | 158 | |
|
159 | 159 | "code_cell": { |
|
160 | 160 | "description": "Notebook code cell.", |
|
161 | 161 | "type": "object", |
|
162 | 162 | "additionalProperties": false, |
|
163 |
"required": ["cell_type", "input", "outputs", |
|
|
163 | "required": ["cell_type", "input", "outputs", "language"], | |
|
164 | 164 | "properties": { |
|
165 | 165 | "cell_type": { |
|
166 | 166 | "description": "String identifying the type of cell.", |
|
167 | 167 | "enum": ["code"] |
|
168 | 168 | }, |
|
169 | 169 | "language": { |
|
170 | 170 | "description": "The cell's language (always Python)", |
|
171 | 171 | "type": "string" |
|
172 | 172 | }, |
|
173 | 173 | "collapsed": { |
|
174 | 174 | "description": "Whether the cell is collapsed/expanded.", |
|
175 | 175 | "type": "boolean" |
|
176 | 176 | }, |
|
177 | 177 | "metadata": { |
|
178 | 178 | "description": "Cell-level metadata.", |
|
179 | 179 | "type": "object", |
|
180 | 180 | "additionalProperties": true |
|
181 | 181 | }, |
|
182 | 182 | "input": {"$ref": "#/definitions/misc/source"}, |
|
183 | 183 | "outputs": { |
|
184 | 184 | "description": "Execution, display, or stream outputs.", |
|
185 | 185 | "type": "array", |
|
186 | 186 | "items": {"$ref": "#/definitions/output"} |
|
187 | 187 | }, |
|
188 | 188 | "prompt_number": { |
|
189 | 189 | "description": "The code cell's prompt number. Will be null if the cell has not been run.", |
|
190 | 190 | "type": ["integer", "null"], |
|
191 | 191 | "minimum": 0 |
|
192 | 192 | } |
|
193 | 193 | } |
|
194 | 194 | }, |
|
195 | 195 | "output": { |
|
196 | 196 | "type": "object", |
|
197 | 197 | "oneOf": [ |
|
198 | 198 | {"$ref": "#/definitions/pyout"}, |
|
199 | 199 | {"$ref": "#/definitions/display_data"}, |
|
200 | 200 | {"$ref": "#/definitions/stream"}, |
|
201 | 201 | {"$ref": "#/definitions/pyerr"} |
|
202 | 202 | ] |
|
203 | 203 | }, |
|
204 | 204 | "pyout": { |
|
205 | 205 | "description": "Result of executing a code cell.", |
|
206 | 206 | "type": "object", |
|
207 | 207 | "additionalProperties": false, |
|
208 | 208 | "required": ["output_type", "prompt_number"], |
|
209 | 209 | "properties": { |
|
210 | 210 | "output_type": { |
|
211 | 211 | "description": "Type of cell output.", |
|
212 | 212 | "enum": ["pyout"] |
|
213 | 213 | }, |
|
214 | 214 | "prompt_number": { |
|
215 | 215 | "description": "A result's prompt number.", |
|
216 | 216 | "type": ["integer"], |
|
217 | 217 | "minimum": 0 |
|
218 | 218 | }, |
|
219 | 219 | "text": {"$ref": "#/definitions/misc/multiline_string"}, |
|
220 | 220 | "latex": {"$ref": "#/definitions/misc/multiline_string"}, |
|
221 | 221 | "png": {"$ref": "#/definitions/misc/multiline_string"}, |
|
222 | 222 | "jpeg": {"$ref": "#/definitions/misc/multiline_string"}, |
|
223 | 223 | "svg": {"$ref": "#/definitions/misc/multiline_string"}, |
|
224 | 224 | "html": {"$ref": "#/definitions/misc/multiline_string"}, |
|
225 | 225 | "javascript": {"$ref": "#/definitions/misc/multiline_string"}, |
|
226 | 226 | "json": {"$ref": "#/definitions/misc/multiline_string"}, |
|
227 | 227 | "pdf": {"$ref": "#/definitions/misc/multiline_string"}, |
|
228 | 228 | "metadata": {"$ref": "#/definitions/misc/output_metadata"} |
|
229 | 229 | }, |
|
230 | 230 | "patternProperties": { |
|
231 | 231 | "^[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$": { |
|
232 | 232 | "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.", |
|
233 | 233 | "$ref": "#/definitions/misc/multiline_string" |
|
234 | 234 | } |
|
235 | 235 | } |
|
236 | 236 | }, |
|
237 | 237 | |
|
238 | 238 | "display_data": { |
|
239 | 239 | "description": "Data displayed as a result of code cell execution.", |
|
240 | 240 | "type": "object", |
|
241 | 241 | "additionalProperties": false, |
|
242 | 242 | "required": ["output_type"], |
|
243 | 243 | "properties": { |
|
244 | 244 | "output_type": { |
|
245 | 245 | "description": "Type of cell output.", |
|
246 | 246 | "enum": ["display_data"] |
|
247 | 247 | }, |
|
248 | 248 | "text": {"$ref": "#/definitions/misc/multiline_string"}, |
|
249 | 249 | "latex": {"$ref": "#/definitions/misc/multiline_string"}, |
|
250 | 250 | "png": {"$ref": "#/definitions/misc/multiline_string"}, |
|
251 | 251 | "jpeg": {"$ref": "#/definitions/misc/multiline_string"}, |
|
252 | 252 | "svg": {"$ref": "#/definitions/misc/multiline_string"}, |
|
253 | 253 | "html": {"$ref": "#/definitions/misc/multiline_string"}, |
|
254 | 254 | "javascript": {"$ref": "#/definitions/misc/multiline_string"}, |
|
255 | 255 | "json": {"$ref": "#/definitions/misc/multiline_string"}, |
|
256 | 256 | "pdf": {"$ref": "#/definitions/misc/multiline_string"}, |
|
257 | 257 | "metadata": {"$ref": "#/definitions/misc/output_metadata"} |
|
258 | 258 | }, |
|
259 | 259 | "patternProperties": { |
|
260 | 260 | "[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$": { |
|
261 | 261 | "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.", |
|
262 | 262 | "$ref": "#/definitions/misc/multiline_string" |
|
263 | 263 | } |
|
264 | 264 | } |
|
265 | 265 | }, |
|
266 | 266 | |
|
267 | 267 | "stream": { |
|
268 | 268 | "description": "Stream output from a code cell.", |
|
269 | 269 | "type": "object", |
|
270 | 270 | "additionalProperties": false, |
|
271 | 271 | "required": ["output_type", "stream", "text"], |
|
272 | 272 | "properties": { |
|
273 | 273 | "output_type": { |
|
274 | 274 | "description": "Type of cell output.", |
|
275 | 275 | "enum": ["stream"] |
|
276 | 276 | }, |
|
277 | 277 | "stream": { |
|
278 | 278 | "description": "The stream type/destination.", |
|
279 | 279 | "type": "string" |
|
280 | 280 | }, |
|
281 | 281 | "text": { |
|
282 | 282 | "description": "The stream's text output, represented as an array of strings.", |
|
283 | 283 | "$ref": "#/definitions/misc/multiline_string" |
|
284 | 284 | } |
|
285 | 285 | } |
|
286 | 286 | }, |
|
287 | 287 | |
|
288 | 288 | "pyerr": { |
|
289 | 289 | "description": "Output of an error that occurred during code cell execution.", |
|
290 | 290 | "type": "object", |
|
291 | 291 | "additionalProperties": false, |
|
292 | 292 | "required": ["output_type", "ename", "evalue", "traceback"], |
|
293 | 293 | "properties": { |
|
294 | 294 | "output_type": { |
|
295 | 295 | "description": "Type of cell output.", |
|
296 | 296 | "enum": ["pyerr"] |
|
297 | 297 | }, |
|
298 | 298 | "metadata": {"$ref": "#/definitions/misc/output_metadata"}, |
|
299 | 299 | "ename": { |
|
300 | 300 | "description": "The name of the error.", |
|
301 | 301 | "type": "string" |
|
302 | 302 | }, |
|
303 | 303 | "evalue": { |
|
304 | 304 | "description": "The value, or message, of the error.", |
|
305 | 305 | "type": "string" |
|
306 | 306 | }, |
|
307 | 307 | "traceback": { |
|
308 | 308 | "description": "The error's traceback, represented as an array of strings.", |
|
309 | 309 | "type": "array", |
|
310 | 310 | "items": {"type": "string"} |
|
311 | 311 | } |
|
312 | 312 | } |
|
313 | 313 | }, |
|
314 | 314 | |
|
315 | 315 | "misc": { |
|
316 | 316 | "metadata_name": { |
|
317 | 317 | "description": "The cell's name. If present, must be a non-empty string.", |
|
318 | 318 | "type": "string", |
|
319 | 319 | "pattern": "^.+$" |
|
320 | 320 | }, |
|
321 | 321 | "metadata_tags": { |
|
322 | 322 | "description": "The cell's tags. Tags must be unique, and must not contain commas.", |
|
323 | 323 | "type": "array", |
|
324 | 324 | "uniqueItems": true, |
|
325 | 325 | "items": { |
|
326 | 326 | "type": "string", |
|
327 | 327 | "pattern": "^[^,]+$" |
|
328 | 328 | } |
|
329 | 329 | }, |
|
330 | 330 | "source": { |
|
331 | 331 | "description": "Contents of the cell, represented as an array of lines.", |
|
332 | 332 | "$ref": "#/definitions/misc/multiline_string" |
|
333 | 333 | }, |
|
334 | 334 | "prompt_number": { |
|
335 | 335 | "description": "The code cell's prompt number. Will be null if the cell has not been run.", |
|
336 | 336 | "type": ["integer", "null"], |
|
337 | 337 | "minimum": 0 |
|
338 | 338 | }, |
|
339 | 339 | "mimetype": { |
|
340 | 340 | "patternProperties": { |
|
341 | 341 | "^[a-zA-Z0-9\\-\\+]+/[a-zA-Z0-9\\-\\+]+": { |
|
342 | 342 | "description": "The cell's mimetype output (e.g. text/plain), represented as either an array of strings or a string.", |
|
343 | 343 | "$ref": "#/definitions/misc/multiline_string" |
|
344 | 344 | } |
|
345 | 345 | } |
|
346 | 346 | }, |
|
347 | 347 | "output_metadata": { |
|
348 | 348 | "description": "Cell output metadata.", |
|
349 | 349 | "type": "object", |
|
350 | 350 | "additionalProperties": true |
|
351 | 351 | }, |
|
352 | 352 | "multiline_string": { |
|
353 | 353 | "oneOf" : [ |
|
354 | 354 | {"type": "string"}, |
|
355 | 355 | { |
|
356 | 356 | "type": "array", |
|
357 | 357 | "items": {"type": "string"} |
|
358 | 358 | } |
|
359 | 359 | ] |
|
360 | 360 | } |
|
361 | 361 | } |
|
362 | 362 | } |
|
363 | 363 | } |
General Comments 0
You need to be logged in to leave comments.
Login now