On Sat, Aug 26, 2017 at 5:31 PM, Christopher Brooks <broo...@umich.edu> wrote:
Hi,I'd like to add some features to the server by capturing code submissions and then doing things like reporting back code complexity, format, etc. I'm unclear whether I would do this with a server extension, or whether I would have to implement my own kernel, or something in between. The REST API for the server as well as what I can understand from the server extension docs make this look like the wrong place -- I don't want to add new API endpoints or, at least, I need to be able to capture the code as it's been pushed to the existing serve for running.The docs on messaging with ZeroMQ were good: http://jupyter-client.readthedocs.io/en/latest/messaging.htmlFollowing this, would an appropriate method be to implement or modify an existing kernel proxy? Or am I barking up the right tree?
If you are only interested in Python, I think that doing this as an IPython extension is probably the simplest thing to do. It is not very easy to intercept executions at the server level, but IPython has events and things that should make it pretty simple.
Here is an example of registering a post_run_cell hook to call a function on every cell that is executed.
(And, if this is the right way to go, does this mean I'm actually looking to change the ipython kernel here? https://github.com/ipython/ipykernel )Finally, do things change with Jupyterlab (which I use every day, fwiw), or is the communication mechanism still the same?
Server and kernel communication is exactly the same with JupyterLab, so anything you do there should be fine in either environment.
-Min
--Regards,Chris
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/97b9d82d-b684-44ed-a026-839e1306d2d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sat, Aug 26, 2017 at 5:31 PM, Christopher Brooks <broo...@umich.edu> wrote:
Hi,I'd like to add some features to the server by capturing code submissions and then doing things like reporting back code complexity, format, etc. I'm unclear whether I would do this with a server extension, or whether I would have to implement my own kernel, or something in between. The REST API for the server as well as what I can understand from the server extension docs make this look like the wrong place -- I don't want to add new API endpoints or, at least, I need to be able to capture the code as it's been pushed to the existing serve for running.The docs on messaging with ZeroMQ were good: http://jupyter-client.readthedocs.io/en/latest/messaging.htmlFollowing this, would an appropriate method be to implement or modify an existing kernel proxy? Or am I barking up the right tree?If you are only interested in Python, I think that doing this as an IPython extension is probably the simplest thing to do. It is not very easy to intercept executions at the server level, but IPython has events and things that should make it pretty simple.
Here is an example of registering a
post_run_cellhook to call a function on every cell that is executed.(And, if this is the right way to go, does this mean I'm actually looking to change the ipython kernel here? https://github.com/ipython/ipykernel )Finally, do things change with Jupyterlab (which I use every day, fwiw), or is the communication mechanism still the same?Server and kernel communication is exactly the same with JupyterLab, so anything you do there should be fine in either environment.
-Min
Regards,Chris
--
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.