<div dir="ltr"><div class="markdown-here-wrapper" style><p style="margin:1.2em 0px!important">It’s relatively straightforward to do this from Javascript:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1.2em 0px"><code class="hljs language-javascript" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,255)">IPython.notebook.metadata.key = <span class="hljs-string">"value"</span>;
</code></pre>
<p style="margin:1.2em 0px!important">There isn’t an API to use from Python, other than raw execution of the above javascript:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1.2em 0px"><code class="hljs language-python" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,255)"><span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> display_javascript
display_javascript(<span class="hljs-string">'IPython.notebook.metadata.key = "value";'</span>, raw=<span class="hljs-keyword">True</span>)
</code></pre>
<p style="margin:1.2em 0px!important">-MinRK</p>
<div title="MDH:SXQncyByZWxhdGl2ZWx5IHN0cmFpZ2h0Zm9yd2FyZCB0byBkbyB0aGlzIGZyb20gSmF2YXNjcmlw
dDo8ZGl2Pjxicj48L2Rpdj48ZGl2PmBgYGphdmFzY3JpcHQ8L2Rpdj48ZGl2PklQeXRob24ubm90
ZWJvb2subWV0YWRhdGEua2V5ID0gInZhbHVlIjs8L2Rpdj48ZGl2PmBgYDwvZGl2PjxkaXY+PGJy
PjwvZGl2PjxkaXY+VGhlcmUgaXNuJ3QgYW4gQVBJIHRvIHVzZSBmcm9tIFB5dGhvbiwgb3RoZXIg
dGhhbiByYXcgZXhlY3V0aW9uIG9mIHRoZSBhYm92ZSBqYXZhc2NyaXB0OjwvZGl2PjxkaXY+PGJy
PjwvZGl2PjxkaXY+YGBgcHl0aG9uPC9kaXY+PGRpdj5mcm9tIElQeXRob24uZGlzcGxheSBpbXBv
cnQgZGlzcGxheV9qYXZhc2NyaXB0PC9kaXY+PGRpdj5kaXNwbGF5X2phdmFzY3JpcHQoJ0lQeXRo
b24ubm90ZWJvb2subWV0YWRhdGEua2V5ID0gInZhbHVlIjsnLCByYXc9VHJ1ZSk8L2Rpdj48ZGl2
PmBgYDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+LU1pblJLPC9kaXY+PGRpdj48YnI+PC9kaXY+" style="height:0;font-size:0em;padding:0;margin:0">​</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 13, 2014 at 2:32 PM, Nolan Nichols <span dir="ltr"><<a href="mailto:nolan.nichols@gmail.com" target="_blank">nolan.nichols@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I'm curious if it is yet possible to edit the Notebook Metadata programatically. I'm familiar with how to do this in the UI manually, but would like to simply inject some json into the metadata using code. Thanks!</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Cheers,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Nolan</div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>