Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Pure Python interface to MySQL?

Reply
Thread Tools

Pure Python interface to MySQL?

 
 
Roy Smith
Guest
Posts: n/a
 
      10-06-2008
Does there exist a pure Python version of a MySQL module? I've got a data
logging application that needs to run on a whole bunch of OSs, ranging from
Windows to a dozen different unix flavors on all sorts of hardware.

Portability is much more important than performance for this application.
We're only inserting a few hundred records a day from each system, but the
ability to quickly deploy to anywhere I've already got Python running is
key.
 
Reply With Quote
 
 
 
 
James Mills
Guest
Posts: n/a
 
      10-06-2008
On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <(E-Mail Removed)> wrote:
> Does there exist a pure Python version of a MySQL module? I've got a data
> logging application that needs to run on a whole bunch of OSs, ranging from
> Windows to a dozen different unix flavors on all sorts of hardware.
>
> Portability is much more important than performance for this application.
> We're only inserting a few hundred records a day from each system, but the
> ability to quickly deploy to anywhere I've already got Python running is
> key.


My solution (tm):

You could implement a proxy server/client
sub-system that you could use to chuck MySQL
statements at the server which would in-turn
use the Python DB-API (mysql-python) module.
This way you would only have to maintain
_one_ instance of the mysql-python module
on the server.

cheers
James

--
--
-- "Problems are solved by method"
 
Reply With Quote
 
 
 
 
Carsten Haese
Guest
Posts: n/a
 
      10-06-2008
Roy Smith wrote:
> Does there exist a pure Python version of a MySQL module?


A quick google search turns up this:

http://github.com/mopemope/pure-pyth...master/pymysql

I've never used it, though, so I have no idea whether it works or how
well it works.

HTH,

--
Carsten Haese
http://informixdb.sourceforge.net
 
Reply With Quote
 
Roy Smith
Guest
Posts: n/a
 
      10-07-2008
In article <kfxGk.3925$(E-Mail Removed)>,
Carsten Haese <(E-Mail Removed)> wrote:

> Roy Smith wrote:
> > Does there exist a pure Python version of a MySQL module?

>
> A quick google search turns up this:
>
> http://github.com/mopemope/pure-pyth...master/pymysql


Awesome, thanks!

You have better searching skills than I do, apparently
 
Reply With Quote
 
James Mills
Guest
Posts: n/a
 
      10-07-2008
On Tue, Oct 7, 2008 at 2:12 PM, Tino Wildenhain <(E-Mail Removed)> wrote:
> Will you be asking for a pure python implementation of mysql
> in the next question? Why not use the proxy approach (for
> example via xmlrpc) as suggested by James or just spill to
> a file?


You could for example use an alternative database:
* buzhug
* ZODB
* Durus
* Or any of: pickle, shelve, XML, or flat file.

All mentioned above are pure-python.
I am maintaining a more up-to-date version of
buzhug in my development brnaches if you're
interested.

cheers
James

--
--
-- "Problems are solved by method"
 
Reply With Quote
 
Gerhard Häring
Guest
Posts: n/a
 
      10-07-2008
James Mills wrote:
> On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <(E-Mail Removed)> wrote:
>> Does there exist a pure Python version of a MySQL module? I've got a data
>> logging application that needs to run on a whole bunch of OSs, ranging from
>> Windows to a dozen different unix flavors on all sorts of hardware.
>>
>> Portability is much more important than performance for this application.
>> We're only inserting a few hundred records a day from each system, but the
>> ability to quickly deploy to anywhere I've already got Python running is
>> key.

>
> My solution (tm):
>
> You could implement a proxy server/client
> sub-system [...]


Or instead of reinventing the wheel, you could use SQLRelay
(http://sqlrelay.sourceforge.net/), which has a pure-Python DB-API module.

-- Gerhard

 
Reply With Quote
 
Roy Smith
Guest
Posts: n/a
 
      10-07-2008
In article <(E-Mail Removed)>,
"James Mills" <(E-Mail Removed)> wrote:

> You could for example use an alternative database:
> * buzhug
> * ZODB
> * Durus
> * Or any of: pickle, shelve, XML, or flat file.


Unfortunately, I don't own the database, just the clients that have to
insert records into it
 
Reply With Quote
 
Skip Montanaro
Guest
Posts: n/a
 
      10-07-2008
> http://github.com/mopemope/pure-pyth...master/pymysql
>
> I've never used it, though, so I have no idea whether it works or how
> well it works.


On the project's home page I noticed:

pymysql is Pure Perl MySQL driver.

pymysql is the Python DB API-2.0 interface.

support MySQL versions 4.1-5.1

Hopefully the code is more robust than the author's proofreading.

Skip


 
Reply With Quote
 
Gerhard Häring
Guest
Posts: n/a
 
      10-07-2008
Gerhard Häring wrote:
> James Mills wrote:
>> On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <(E-Mail Removed)> wrote:
>>> Does there exist a pure Python version of a MySQL module? I've got a
>>> data
>>> logging application that needs to run on a whole bunch of OSs,
>>> ranging from
>>> Windows to a dozen different unix flavors on all sorts of hardware.
>>>
>>> Portability is much more important than performance for this
>>> application.
>>> We're only inserting a few hundred records a day from each system,
>>> but the
>>> ability to quickly deploy to anywhere I've already got Python running is
>>> key.

>>
>> My solution (tm):
>>
>> You could implement a proxy server/client
>> sub-system [...]

>
> Or instead of reinventing the wheel, you could use SQLRelay
> (http://sqlrelay.sourceforge.net/), which has a pure-Python DB-API module.


Unfortunately, the Python interface for SQLRelay seems to include parts
written in C. What a pity.

-- Gerhard

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pure space directly inside div ignored, but pure space directlyinside span honored liketofindoutwhy@gmail.com HTML 4 03-29-2008 06:06 PM
Pure functions still pure after definition Todd Aspeotis C++ 3 05-30-2005 03:53 AM
Python 2.4, distutils, and pure python packages Fuzzyman Python 5 03-12-2005 12:19 PM
Popular Python projects with lots of pure Python code Brett C. Python 11 08-13-2004 04:01 AM
Re: Popular Python projects with lots of pure Python code Mike C. Fletcher Python 1 08-10-2004 07:59 AM



Advertisments