[IPython-dev] API to Modify Notebook Metadata

MinRK benjaminrk at gmail.com
Sun Sep 14 13:57:35 EDT 2014


On Sat, Sep 13, 2014 at 8:51 PM, Jason Grout <jason-sage at creativetrax.com>
wrote:

>
>
> On 9/13/14, 17:55, MinRK wrote:
> > It’s relatively straightforward to do this from Javascript:
> >
> > |IPython.notebook.metadata.key ="value";
> > |
> >
> > There isn’t an API to use from Python, other than raw execution of the
> > above javascript:
> >
> > |from  IPython.displayimport  display_javascript
> > display_javascript('IPython.notebook.metadata.key = "value";', raw=True)
> > |
> >
>
>
> That display_javascript won't work once the iframe security mechanisms
> are introduced, will it?  I think it would be really useful to have a
> natural way to access/modify the notebook metadata dict from python.  Or
> more generally, a way to store some metadata information about the
> current session that should be available the next time this code is run
> or be available as part of the metadata for the current "document" of
> code (whatever that means in the current context).
>

It remains unclear whether iframes are going to work out at all. In any
case, we probably will want to preserve access to the notebook document
structure in javascript in some way.


>
> Perhaps we could have something like having
> get_ipython().notebook.metadata be an eventful dict that synchronizes
> with the javascript.


> I know this discussion of whether the kernel should be aware of the
> frontend has come up before in various contexts, and I think it will
> keep coming up.
>

It does indeed. Still no decision on whether we should break the model yet,
but we keep talking about it.


>
> Jason
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140914/49f8bc91/attachment.html>


More information about the IPython-dev mailing list