[IPython-dev] Static code analysis of IPython Notebook cell

Thomas Wiecki thomas.wiecki at gmail.com
Mon Jul 7 01:20:51 EDT 2014


Hi all,

I'm trying to do some static syntax checks (AST parsing) on the code in an
IPyNB cell and then either execute the cell or not. I'd also like to
control the output that the cell produces.

With the magic-interface I know that I can define a function that gets the
cell code as a string. This would work well here except that I want this
for all cells.

With my limited understanding of the IPyNB internals I would see three ways
this could be achieved:
* There is a hook in the IPyNB I can use like the magic
* I have to change the IPyNB client code to do the analysis before it's
sent to the kernel.
* I change the kernel to do the analysis.

Which of these is the best? Can someone point me to the relevant code
section I would need to make changes to?

Thanks,
Thomas

-- 
Thomas Wiecki
PhD candidate, Brown University
Quantitative Researcher, Quantopian Inc, Boston
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140707/38b11e30/attachment.html>


More information about the IPython-dev mailing list