[Generalising] Has anyone succeeded with seeding a notebook with external arguments?

44 views
Skip to first unread message

Pav A

unread,
Jan 12, 2017, 8:51:19 AM1/12/17
to Project Jupyter
Either:
* via a POST request to the notebook
* jquery bbq parser talking to Python kernel via Javascript (note: this is explicitly not supported in Jupyter Dashboards: https://github.com/jupyter/dashboards_server/issues/309#issuecomment-267205021)
* any other way?

Pav A

unread,
Jan 17, 2017, 2:02:22 PM1/17/17
to Project Jupyter
Anyone? :)

Matthias Bussonnier

unread,
Jan 17, 2017, 2:14:03 PM1/17/17
to jup...@googlegroups.com
Hi Pav,

From the command line you can use things like
https://github.com/paulgb/runipy, or
https://github.com/takluyver/nbparameterise.

If you are running pure nbconvert, then environment variable may be
enough. Otherwise you have to dive into creating your own
kernel/session manager to do fancy stuff when the kernel starts.

Hope that helps a bit.
--
M
> --
> 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+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/d624f690-188e-469e-88d9-9a438097f579%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Erik Stephens

unread,
Jan 17, 2017, 7:02:53 PM1/17/17
to Project Jupyter
I've used javascript magic to get the url into python land:

%%javascript
IPython.notebook.kernel.execute('url = "' + window.location.href + '"');

then parse it with python:

from urllib.parse import urlparse, parse_qsl
qs = dict(parse_qsl(urlparse(url).query))

--
Erik
Reply all
Reply to author
Forward
0 new messages