title: ipython notebook: custom cells and execute hook
body: <p>I would like to override what happens when run is pressed for certain cells in ipython notebook. </p>
  
  <p>For example, I would like to be able to write an SQL query directly in a cell and define a function that processes it.</p>
  
  <p>It seems it should be possible to do this as with <a href="https://github.com/ipython-contrib/IPython-notebook-extensions" rel="nofollow">ipython-notebook extensions</a>. Does anyone know of a similar extension? An easy way to do this directly from ipython?</p>
  
  <p>Ideally this would involve defining a custom cell type, but I would be happy to use special tags to separate the usual python code from, say, a custom SQL query cell.</p>