[IPython-dev] Adding attributes to .ipynb files

MinRK benjaminrk at gmail.com
Thu Jun 14 20:09:23 EDT 2012


You mean something like this <https://github.com/ipython/ipython/pull/1934>?

Adding your own (jsonable) data into those metadata dicts should be safe.
 I would recommend using your own prefix or subdict to avoid potential
collisions down the road.

On Thu, Jun 14, 2012 at 4:13 PM, Dennis Sun <dlsun at stanford.edu> wrote:

> Hi all,
>
> We're working on a project where we need notebook files that have some
> extra data attached to each cell. Because we would like to make sure that
> the files are still compatible with the iPython Notebook, what we're doing
> right now is including this metadata in the "json" attribute of the output
> of each cell and then "promoting" these attributes to the cell level at
> runtime. Thus, the notebook file is still a valid .ipynb file, but the
> metadata doesn't show up when the user loads the page.
>
> However, it seems right now that we can get away with adding the metadata
> directly at the cell level in the .ipynb file, since iPython Notebook
> simply passes over any keys that it doesn't know to look for. We would like
> to do this instead, since it is conceptually much cleaner, but we are
> worried about compatibility with future versions of iPython, which might
> enforce .ipynb files to follow a certain format.
>
> We were hoping that someone more knowledgeable about the state of iPython
> development could advise on whether or not it's safe to add our own
> attributes directly to the .ipynb files. It seems that this shouldn't be a
> problem as long as .ipynb remains a JSON key-value store, but we wanted to
> check with the community to make sure.
>
> Thanks,
> Dennis
>
> _______________________________________________
> 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/20120614/3fbfcecd/attachment.html>


More information about the IPython-dev mailing list