[IPython-User] add new metadata in the current notebook
Tue Mar 5 15:14:34 CST 2013
sorry for the late response to the topic.
i'll look fwd to see any changes on that direction.
what i was looking for is a way to build a "custom form" that is connected with the full notebook (not all the cells)
in order to allow the user to fill that form and store the metadata into the notebook.
the idea is to generate that form reading a sort of configuration file, so it can be customized based on different use cases.
Maybe of interest to others here, the reason why i'm doing this is to have some "hidden metadata" to collect the "provenance" of a specific workflow following the W3C standard ( prov-dm  or prov-o  )
in the main time i'm studying the w3c standards … i have to work on a list of possible metadata tags that i need to embed in the notebook for my specific use case.
i'll let you know how it goes (i'm studying the raw input function)
Il giorno 23/feb/2013, alle ore 05:18, Matthias BUSSONNIER <email@example.com> ha scritto:
> Hi Massimo,
> Le 23 févr. 2013 à 03:03, epi a écrit :
>> 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)
> Yes, this is something we want to add. We will first finish moving to bootstrap before writing the UI for that.
> Al also planned on adding "license" and stuff like that and make it available in nbconvert/viewer.
> ANd it is one of the things that are annoying me right now and that I would like to have.
> The "author" will more probably be "authors" and be a list of dict with fields like
> name, email, github_handle, adress... etc we have to think carefully of the structure.
> Metadata would also store things like the main language of the notebook (it won't by only python forever !)
> An IPEP would be welcomed with proposal of data structure.
>> 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
> I would suggest looking at
> That provide a "raw edit" button for metadata on the per-cell basis.
> That would require writing Json by hand for now.
> Also, if you go this way now I would suggest you put the metadata in a sub key to avoid future conflict.
>> 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')
> Yes, this would be the right way to do it, maybe with get() to avoid non existing keys...
>> Have you any suggestion ?
>> IPython-User mailing list
> IPython-User mailing list
More information about the IPython-User