Pure Python interface to MySQL?

Discussion in 'Python' started by Roy Smith, Oct 7, 2008.

  1. Roy Smith

    Roy Smith Guest

    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.
    Roy Smith, Oct 7, 2008
    #1
    1. Advertising

  2. Roy Smith

    James Mills Guest

    On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <> 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"
    James Mills, Oct 7, 2008
    #2
    1. Advertising

  3. Carsten Haese, Oct 7, 2008
    #3
  4. Roy Smith

    Roy Smith Guest

    Roy Smith, Oct 7, 2008
    #4
  5. Roy Smith

    James Mills Guest

    On Tue, Oct 7, 2008 at 2:12 PM, Tino Wildenhain <> 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"
    James Mills, Oct 7, 2008
    #5
  6. James Mills wrote:
    > On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <> 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
    Gerhard Häring, Oct 7, 2008
    #6
  7. Roy Smith

    Roy Smith Guest

    In article <>,
    "James Mills" <> 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 :-(
    Roy Smith, Oct 7, 2008
    #7
  8. > http://github.com/mopemope/pure-python-mysql/tree/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
    Skip Montanaro, Oct 7, 2008
    #8
  9. Gerhard Häring wrote:
    > James Mills wrote:
    >> On Tue, Oct 7, 2008 at 9:15 AM, Roy Smith <> 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
    Gerhard Häring, Oct 7, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Aspeotis
    Replies:
    3
    Views:
    451
    Kanenas
    May 30, 2005
  2. Ravi
    Replies:
    6
    Views:
    1,398
    Suchandra Thapa
    Jul 21, 2003
  3. Rick Morrison

    Python Interface to MySQL 4.1 / 5.0

    Rick Morrison, Feb 3, 2004, in forum: Python
    Replies:
    0
    Views:
    279
    Rick Morrison
    Feb 3, 2004
  4. Replies:
    4
    Views:
    774
    Ben C
    Mar 29, 2008
  5. Carl
    Replies:
    1
    Views:
    324
    James Mills
    Oct 28, 2008
Loading...

Share This Page