why does php have a standard SQL module and Python doesn't !?

S

seb.haase

Hi,
I thought I would quickly write a
"SELECT * FROM ... " line in python ...
.... but then I was suprised to find that the only "official" web page I
found was mainly linking to the PEP on HOW the DB API2.0 should look
like.
Then there is a choice of maybe ten modules which more or less all
claim to implement 99% of that PEP.

What is the best (easiest ! quickest !) way to get started doing some
SQL in Python ?
(I have mySQL running on a Linux box in our Lab and would like to
access it from Windows (or MacOSX) on some other machine also in the
same subnet)

Sebastian Haase
UCSF
 
H

Heiko Wundram

What is the best (easiest ! quickest !) way to get started doing some
SQL in Python ?

SQL isn't SQL, and there is no "standard" SQL module, not even in PHP (which
ships with modules for MySQL, PostgreSQL and MSSQL/Sybase IIRC). It all
depends on the database backend. See below.
(I have mySQL running on a Linux box in our Lab and would like to
access it from Windows (or MacOSX) on some other machine also in the
same subnet)

For MySQL, try MySQLdb, which is a Python module to allow access to the
MySQL database (what you seem to want to do). Just Google for it. MySQLdb
is DB-API 2.0 compatible.

--- Heiko.
 
G

Greg Copeland

To build on Heiko's comment's, and to be clear, Python does have a
standard interface description, to which many SQL interfaces are
available.
 
S

seb.haase

This was my point though: I found the *description* - but no wordon
WHICH implementation to get WHERE ?
Don't get me wrong - I like Python and I will stick to it for some time
to come ...
but WHY are the places to get those SQL implementations not better
marked:
Just try to google for "python sql" and you get here:
http://sourceforge.net/projects/pysqldb/
(then this like to home page (http://pysqldb.sourceforge.net/) is
COMPLETELY EMPTY !!!!)
the next number of hits seem to be completely random.

Even if you google for: python mysql
you get to http://sourceforge.net/projects/mysql-python where
the linked "home page" says:
** OBSOLETE Python Interface to MySQL **

Please try to understand what I'm saying here:
This is essentially a proof the there is no (one) good place to go for
SQL & Python.
Instead it looked really scary to me!
How could I have known that "MySQLdb" is the keyword to google for !?

It would be nice, if those projects would reference back to
"http://www.python.org/topics/database/modules.html" just to give some
assurance that one is not totally off ...

Thanks,
Sebastian
 
D

Dennis Lee Bieber

Even if you google for: python mysql
you get to http://sourceforge.net/projects/mysql-python where
the linked "home page" says:
** OBSOLETE Python Interface to MySQL **
The text also states:

""""
These are old versions, and not supported at all. Please use the
SourceForge link for up-to-date versions.
""""
Please try to understand what I'm saying here:
This is essentially a proof the there is no (one) good place to go for
SQL & Python.
Instead it looked really scary to me!
How could I have known that "MySQLdb" is the keyword to google for !?
Would the minor factor that out of the first seven hits (that I just
got on "python mysql") FOUR of them have summaries mentioning "MySQLdb"
be of use? And the first two both reference SourceForge?
--
 
K

Kent Johnson

This was my point though: I found the *description* - but no wordon
WHICH implementation to get WHERE ?

Hmm.
- Browse to http://www.python.org
- click Documentation
- click Database API
- click Database Modules (Database modules that implement the DB-API specification.)
- read list, find the database of your choice

Kent
 
S

seb.haase

OK,
point taken - maybe what threw me off was the simple fact that there
CAN be NO "ONE standard/default SQL package".
As a newbie in sql I was hoping to find something like e.g. the socket
module (one size fits all)

So: Maybe this could be explained on the "Database Modules" page.
(and again: just being on sourceforge doesn't mean a project is still
being developped - for all one call tell from the first look, they
could be abandoned - hint: have a better homepage !!)

Thanks,
Sebastian
 
K

Kent Johnson

OK,
point taken - maybe what threw me off was the simple fact that there
CAN be NO "ONE standard/default SQL package".
As a newbie in sql I was hoping to find something like e.g. the socket
module (one size fits all)

So: Maybe this could be explained on the "Database Modules" page.

If you can suggest some text, email it to the webmaster using the address on that page.
(and again: just being on sourceforge doesn't mean a project is still
being developped - for all one call tell from the first look, they
could be abandoned - hint: have a better homepage !!)

This hint needs to go to the MySQL for Python folks, it's their home page.

Kent
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top