3

We have a web app that allows users to interactively discover web service data URLs. We would like to allow a discovered service URL to be sent to an Ipython Notebook, where data from the service could be extracted, analyzed and visualized in the notebook. Is that possible?

Rich Signell
  • 14,842
  • 4
  • 49
  • 77

1 Answers1

3

This topic : Connecting to a remote IPython instance

will show you how to execute python code from an app/script and return any "python objects" back to the notebook kernel.

Essentially what i will do in this case is to execute python code from the web app using the approach described before, note that for recent version of IPython (i use 3.0-dev) you should change :

from IPython.zmq.blockingkernelmanager import BlockingKernelManager

to :

from IPython.kernel import BlockingKernelClient

If your web-app can receive parameters in the url, you can construct the url+query from the notebook giving the connection info as one of the input parameters. You can retrieve the connection ifo within the notebook using:

%connect_info
Community
  • 1
  • 1
epifanio
  • 1,228
  • 1
  • 16
  • 26
  • One note, in this scenario web-app and IPython notebook need to run on the same machine. – epifanio Jun 09 '14 at 11:19
  • have a look a this notebook : http://nbviewer.ipython.org/gist/epifanio/08f33dd8cea8d8564abf It shows how to connect flask with a running ipython notebook kernel and pass simple parameters to it. In the example flask generate a python dict based on imput from the url, the generated dict is then available in the ipython kernel. – epifanio Jul 01 '14 at 18:02