473,785 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Dec 15 '05 #1
6 1182
se*******@gmail .com wrote:
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.
Dec 15 '05 #2
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.

Dec 15 '05 #3
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

Dec 16 '05 #4
se*******@gmail .com wrote:
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
Dec 16 '05 #5
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

Dec 16 '05 #6
se*******@gmail .com wrote:
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

Thanks,
Sebastian

Dec 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3116
by: Greg Kuperberg | last post by:
I plan to use pydoc for my Python project. After looking through the standard documentation, I am not sure how pydoc interprets its input. In its basic operation it evidently looks at the first string literal in the module and in each function definition. But there is more to the story than that, obviously. What other vestigial code does it detect? Every string literal? Variables of the form __xxx__, I gather? Which of these variables...
2
2440
by: F. Petitjean | last post by:
I have written a script to find the modules which export the largest number of names. The gc.getreferrers(*objs) function gives also an idea of the dependencies between the modules. The code (statsmod.py) : #!/usr/bin/env python # -*- coding: latin-1 -*- """
11
2165
by: Grant Edwards | last post by:
I've read over and over that Python leaves floating point issues up to the underlying platform. This seems to be largely true, but not always. My underlying platform (IA32 Linux) correctly handles 1.0/0.0 and 0.0/0.0 according to the IEEE 754 standard, but Python goes out of its way to do the wrong thing. 1/0 is defined by the standard as +Inf and 0/0 is NaN.
113
5310
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. The built-in SSL support is weak. Even basic sockets don't quite work right; the socket module...
3
275
by: Daniel Fetchinson | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Sqlite itself is not distributed with python. Only a python db api compliant wrapper is part of the python stdlib and as such it is completely independent of the sqlite build. In other words, if your sqlite build supports full text searching you can use it through the python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.