[IPython-dev] SQLite kernel

Doug Blank doug.blank at gmail.com
Wed May 7 15:35:06 EDT 2014


On Mon, May 5, 2014 at 3:19 PM, Greg Wilson <gvwilson at third-bit.com> wrote:

>  http://github.com/gvwilson/sqlitemagic may also be of interest - it's
> what we use to produce the Software Carpentry lesson on SQL.
>

That is a ridiculously simple and effective 50 lines of code. It isn't a
SQLite shell, but it does 80% of what one would want from a SQLite kernel.

Thanks for that!

-Doug



> thx,
> G
>
>
> On 2014-05-05 1:55 PM, Martin Gadbois wrote:
>
> Wow that was there but not found by Google... nice! I will take a close
> look, thanks!
>
>
> On Mon, May 5, 2014 at 11:52 AM, Jessica B. Hamrick <jhamrick at berkeley.edu
> > wrote:
>
>> Hi all,
>>
>>  I jut wanted to throw out there a link to the SQL magic, which may be
>> relevant:
>>
>>  https://github.com/catherinedevlin/ipython-sql
>>
>>  I know it's not a whole kernel, but may be a good starting place for at
>> least seeing what other people have been thinking about along the same
>> directions.
>>
>>  Cheers,
>>  Jess
>>
>>  --
>> UC Berkeley, Department of Psychology
>> Computational Cognitive Science Lab
>> http://www.jesshamrick.com
>>
>>
>> On Mon, May 5, 2014 at 8:28 AM, Doug Blank <doug.blank at gmail.com> wrote:
>>
>>>   On Mon, May 5, 2014 at 11:00 AM, Martin Gadbois <mgadbois at gmail.com>wrote:
>>>
>>>>  Hi!
>>>>
>>>>  I would like to develop a SQLite kernel for IPython.
>>>>
>>>> Keyword, table and column completion would help building queries, and a
>>>> dynamic output could resize text columns and have a proper notebook table
>>>> output.
>>>>
>>>>  To achieve that, I see two main directions:
>>>>  1- Have an external kernel  (like
>>>> http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb)
>>>> coded in Python since there are no 0MQ bindings for SQLite.
>>>>  2- Extend IPython itself to support SQLite, since I will need to
>>>> write Python code anyway to support SQLite.
>>>>
>>>
>>>  I've wanted something like this for a while! I would like to
>>> incorporate SQL as a language that could easily be used in a variety of
>>> educational settings and other open source projects. But the utility of
>>> such a project lies in the details of implementation.
>>>
>>>  There are pros and cons to both approaches. But you could perhaps
>>> develop it in a manner that could be used in either situation. What would
>>> generally be useful would be to replicate the SQLite shell. It would be
>>> great if the parser was written in pure Python, and had an interpreter,
>>> also as much written in pure Python as possible. That is, it would be great
>>> if the low-level C-based sqlite API was limited, and could be swapped out.
>>>
>>>  That would allow other implementations of Python (Jython, PyPy,
>>> IronPython) could use it with their own sqlite wrappers. But also, that
>>> might make it useful for interfacing other data storages (for example, CSV
>>> files, Django databases, etc.)
>>>
>>>  The SQLite shell is actually a bit hairy. Here is a port of the C code
>>> to C# for example:
>>>
>>>  http://stackoverflow.com/questions/12620673/net-sqlite-sql-shell
>>>
>>>  You could also use the simple-kernel [1] as a way of quickly turning a
>>> Python program into a kernel. (simple-kernel was just updated by Min, so
>>> now it is correct; thanks, Min!)
>>>
>>>  This might also have connections to the ADODB API [2]... they have
>>> worked hard to make their connections be Python-implementation agnostic.
>>>
>>>  Looking forward to see what you develop!
>>>
>>>  -Doug
>>>
>>>  [1] https://github.com/dsblank/simple_kernel
>>> [2] https://sourceforge.net/projects/adodbapi
>>>
>>>
>>>>
>>>>  What would this list recommend as an implementation strategy?
>>>>  Any example of creating an external kernel by reusing a subset of
>>>> IPython itself?
>>>>
>>>>  Thanks!
>>>>
>>>>  --
>>>> Martin
>>>>
>>>>  _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
>
> --
> Martin
>
>
> _______________________________________________
> IPython-dev mailing listIPython-dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140507/046b41df/attachment.html>


More information about the IPython-dev mailing list