[IPython-User] add new metadata in the current notebook

epi massimodisasha@gmail....
Fri Feb 22 20:03:45 CST 2013

Hi All,

i was looking for a way to add new "hidden metadata" such as "author" , "date", "description" .. others in the "current notebook" (e.g. during a notebook session)

i was thinking something like :

def addNbTag(key, val):    
    # add the new tag in the current notebook
    # and save it 
    # nbdir =  check the notebook.dir
    # nbname = check the current notebook name
    # nb = nbdir/nbname
    # nb[u'metadata'][u'key'] = 'val'
    # save the notebook embedding the new metadata


in order to be able to do in python  :

from IPython.nbformat import current
f = open('file.ipynb','r')
s = f.read()
nb = current.reads(s, u'json')

Have you any suggestion ?



More information about the IPython-User mailing list