This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: html.services.notebooks.handlers

Tornado handlers for the notebooks web service.


  • Brian Granger

3 Classes

class IPython.html.services.notebooks.handlers.NotebookHandler(application, request, **kwargs)

Bases: IPython.html.base.handlers.IPythonHandler

delete(*args, **kwargs)

delete the notebook in the given notebook path

get(*args, **kwargs)

Return a Notebook or list of notebooks.

  • GET with path and no notebook name lists notebooks in a directory
  • GET with path and notebook name returns notebook JSON
notebook_location(name, path='')

Return the full URL location of a notebook based.


name : unicode

The base name of the notebook, such as “foo.ipynb”.

path : unicode

The URL path of the notebook.

patch(*args, **kwargs)

PATCH renames a notebook without re-uploading content.

post(*args, **kwargs)

Create a new notebook in the specified path.

POST creates new notebooks. The server always decides on the notebook name.

POST /api/notebooks/path
New untitled notebook in path. If content specified, upload a notebook, otherwise start empty.
POST /api/notebooks/path?copy=OtherNotebook.ipynb
New copy of OtherNotebook in path
put(*args, **kwargs)

Saves the notebook in the location specified by name and path.

PUT is very similar to POST, but the requester specifies the name, whereas with POST, the server picks the name.

PUT /api/notebooks/path/Name.ipynb
Save notebook at path/Name.ipynb. Notebook structure is specified in content key of JSON request body. If content is not specified, create a new empty notebook.
PUT /api/notebooks/path/Name.ipynb?copy=OtherNotebook.ipynb
Copy OtherNotebook to Name
class IPython.html.services.notebooks.handlers.NotebookCheckpointsHandler(application, request, **kwargs)

Bases: IPython.html.base.handlers.IPythonHandler

get(*args, **kwargs)

get lists checkpoints for a notebook

post(*args, **kwargs)

post creates a new checkpoint

class IPython.html.services.notebooks.handlers.ModifyNotebookCheckpointsHandler(application, request, **kwargs)

Bases: IPython.html.base.handlers.IPythonHandler

delete(*args, **kwargs)

delete clears a checkpoint for a given notebook

post(*args, **kwargs)

post restores a notebook from a checkpoint