In general, the python (kernel) does not know if it is running code from a
notebook, console, or some other service. The architecture is specifically
designed to be agnostic that way to give you great power and flexibility in
how to run code. For example, it's easy to run one cell from a notebook,
open up a console to the same kernel, and run the next few bits of code
from the console as you investigate the environment interactively outside
of the notebook. As such, I don't know of any way to tell from a given
piece of code being run that it is (a) sent from a notebook, and (b) get
the metadata from the notebook.

Of course, if you are just talking about using the python kernel to open up
a notebook file itself, you can retrieve the metadata by just reading in
the notebook JSON.

Thanks,

Jason


On Mon, Feb 19, 2018 at 7:09 AM Stefano Antonel <stefanoanto...@gmail.com>
wrote:

> Hi I need to access the Notebook metadata using python.
> I'm able to get it using javascript like IPython.notebook.metadata but I
> don't like it at all.
> There is any option with python?
>
> Stefano
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/52cb2e92-c5ea-46fd-a402-e19279dc3cb4%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/52cb2e92-c5ea-46fd-a402-e19279dc3cb4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHwQfBR_6WZzfFqFSv5fsqjdQ_iYGRpZLHbb9tzMS%2BioLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to