How to integrate IPython Kernel in third party software

78 views
Skip to first unread message

Jeff Zhang

unread,
Jul 1, 2017, 10:23:37 AM7/1/17
to Project Jupyter

I'd like to integrate IPython kernel in thrift party software, do python REPL in third party software. But I could not find document about how to integrate IPython kernel to third party software.

Could anyone point me some materials on that ? Thanks


Jeff Zhang

unread,
Jul 1, 2017, 7:15:47 PM7/1/17
to Project Jupyter
I found the following link on how to embed ipython into other third party tools. But what I want is not interact ipython via shell, what I want is something like jupyter notebook. 
So I think I need to start ipython kernel in a separate process, and then communicate it with RPC.  Does anyone know the IPython's rpc protocol or what kind of API I can use to interact with ipython kernel. 

在 2017年7月1日星期六 UTC+8下午10:23:37,Jeff Zhang写道:

Kyle Kelley

unread,
Jul 1, 2017, 8:09:48 PM7/1/17
to jup...@googlegroups.com
Hey Jeff,


It's worth taking a look at how the notebook serves up the protocol on websockets and communicates with them from frontends: https://github.com/jupyter/notebook


--
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+unsubscribe@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/db4f20ae-55e5-4d4d-94eb-fcea6bf87dbd%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Kyle Kelley (@rgbkrklambdaops.com)

Jeff Zhang

unread,
Jul 1, 2017, 9:35:57 PM7/1/17
to Project Jupyter

I find one simpler approach to do that, just ues jupyter_client api. But I could not get the execute response correctly. Could anyone help on that ? Thanks

Here's my sample code

import jupyter_client
kernel_manager, kernel_client = jupyter_client.manager.start_new_kernel(kernel_name='python3')
kernel_client.execute("print('hello world')")
kernel_client.get_shell_msg() 

在 2017年7月2日星期日 UTC+8上午8:09:48,rgbkrk写道:
Hey Jeff,


It's worth taking a look at how the notebook serves up the protocol on websockets and communicates with them from frontends: https://github.com/jupyter/notebook

On Sat, Jul 1, 2017 at 4:15 PM, Jeff Zhang <zjf...@gmail.com> wrote:
I found the following link on how to embed ipython into other third party tools. But what I want is not interact ipython via shell, what I want is something like jupyter notebook. 
So I think I need to start ipython kernel in a separate process, and then communicate it with RPC.  Does anyone know the IPython's rpc protocol or what kind of API I can use to interact with ipython kernel. 

在 2017年7月1日星期六 UTC+8下午10:23:37,Jeff Zhang写道:

I'd like to integrate IPython kernel in thrift party software, do python REPL in third party software. But I could not find document about how to integrate IPython kernel to third party software.

Could anyone point me some materials on that ? Thanks


--
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.

Thomas Kluyver

unread,
Jul 3, 2017, 11:41:42 AM7/3/17
to Project Jupyter
On 2 July 2017 at 02:35, Jeff Zhang <zjf...@gmail.com> wrote:
I find one simpler approach to do that, just ues jupyter_client api. But I could not get the execute response correctly. Could anyone help on that ? Thanks

Have a look at the code nbconvert uses to execute notebooks - this uses jupyter_client in a similar way:

https://github.com/jupyter/nbconvert/blob/master/nbconvert/preprocessors/execute.py

Reply all
Reply to author
Forward
0 new messages