Send code snippet for execution to Jupyter Kernel Gateway through API

649 Views Asked by At

I need to execute a python script on the jupyter kernel gateway through the websocket mode of the API.

Not sure if this is can be accomplished via the websocket mode, as there is hardly any resource available online and the docs for this particular personality is not very suggestive.

My question: How do we accomplish this?

p.s. This is not the same scenario as accomplished by http-mode to run code already present in a static notebook.

Any leads would be very helpful!

1

There are 1 best solutions below

0
On

Yes, it can be accomplished. There is no extra documentation for it, because the API for kernels and code execution provided by Jupyter Kernel Gateway is the exact same as for Jupyter Notebook.

Depending on the client language you're using, there may be client libraries that make the task simpler. For Javascript, give @jupyterlab/services a try.