[IPython-dev] NotebookManager API

Brian Granger ellisonbg at gmail.com
Tue Jan 28 12:36:54 EST 2014


Konrad,

On Tue, Jan 28, 2014 at 7:14 AM, Konrad Hinsen
<konrad.hinsen at fastmail.net> wrote:
> I am working on my NotebookManager, using IPython.html.services.notebooks.nbmanager,
> IPython.html.services.notebooks.filenbmanager, and the "bookstore" plugin
> as a guidance. However, my NotebookManager differs in one fundamental aspect:
> its backing store is not a filesystem, meaning there are no filenames and in
> particular no extensions.

While the backend doesn't need to be a filesystem, it does need to
have the same abstractions:

* /paths/like/this
* filesname
* filename extensions

You can store this in you storage backend in whatever way you want,
but this stuff is hard coding throughout the web application, not just
the nbmanager. This is a deliberate choice that we have no plans on
changing. In fact we just refactored all of this stuff to give it this
design since 1.0.

Here is our IPEP on the topic:

https://github.com/ipython/ipython/wiki/IPEP-16%3A-Notebook-multi-directory-dashboard-and-URL-mapping

> Is there any documentation for the NotebookManager API that is more
> precise than the existing implementations? I wonder in particular
> about the rules for the "path" and "name" arguments of the various
> methods. One problem I am fighting with is that my get_notebook_model
> gets called sometimes with the notebook names that I return in
> list_notebooks, but sometimes with the names suffixed with ".ipynb". I
> also see calls to list_notebooks with values of "path" that don't
> satisfy my path_exists test.

We don't have anything on NotebookManager per-se, but the above IPEP
will describe things from a conceptual perspective and how all it maps
onto URLs.

> Inspecting the source code, I wonder what the distinction between the
> classes NotebookManager and FileNotebookManager is. The names suggest
> that FileNotebookManager is specific to a filesystem-based manager,
> whereas NotebookManager is generic, but NotebookManager already
> contains calls to os.path. I am writing my own manager as a subclass
> of NotebookManager, but perhaps I shouldn't.

We may have some leakage in the base class that needs to be fixed, but
yes, you should be subclassing the base class.

Cheers,

Brian

> Konrad.
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list