[IPython-dev] custom web notebook cells

Jason Grout jason-sage@creativetrax....
Sat Dec 15 15:31:41 CST 2012


On 12/15/12 1:37 PM, Brian Granger wrote:

> I have started to become very concerned about the metadata.  Our
> thinking so far has been: that metadata is complete unstructured.
> IOW, users can write to the metadata section whatever they want.  When
> nobody is doing that it works fine, but as more people start to use
> the metadata, it is going to turn into the wild west.  There will be
> conflicting metadata.  There will backwards incompatibilties.  We will
> allow this for a while, but when users start to complain that there
> notebooks don't work as expected, we will have to become extremely
> conservative about the metadata.
>
> Case in point: we are about to add a slideshow section to the cell
> level metadata.  And the notebook UI will rely on this metadata being
> in a very particular format.  If we *ever* change that metadata in the
> future, we will have to increment the notebook document format version
> to reflect it.  Some changes (adding a new attribute) won't be
> backwards incompatible, but some might be and it will affect the
> entire notebook document format.

Is the solution (to quote python zen): "Namespaces are one honking great 
idea -- let's do more of those!"?

Suppose the metadata dictionary is actually a key-value store where the 
key is the namespace for the metadata.  You reserve the "ipython" key, 
so that it is safe to make rigid rules and assumptions about anything in 
metadata['ipython'].  Allow others to make arbitrary other metadata 
namespaces and values.

Thanks,

Jason




More information about the IPython-dev mailing list