473,287 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Out of the box database support

Hey there.

I was wondering whether Python had any support out-of-the-box for
database functionality, or database-like functionality.

For instance a lot of shared hosts have Python installed, but not the
MySQL extension, the flexible of these would install it, but most of
the time they wouldn't bother.

I was really looking for something like SQLite which ships bundled
with PHP these days. Or any standard way of connecting to generic
databases out of the box, i.e. MySQL.
Thanks for reading.
Alex Biddle.
Jul 3 '06 #1
13 1382
Alex Biddle <he*******@gmail.comwrote:
Hey there.

I was wondering whether Python had any support out-of-the-box for
database functionality, or database-like functionality.

For instance a lot of shared hosts have Python installed, but not the
MySQL extension, the flexible of these would install it, but most of
the time they wouldn't bother.

I was really looking for something like SQLite which ships bundled
with PHP these days. Or any standard way of connecting to generic
databases out of the box, i.e. MySQL.
Python 2.5's standard library includes pysqlite. For any other DB, or
any previous release of Python, you need separate downloads.

Of course, shared hosts that are too lazy (and uninterested in
supporting Python) to perform a 20-seconds download and install, will
hardly be upgrading to Python 2.5 in the next 20 years or so, therefore
I doubt that pysqlite becoming part of the standard library is of any
help to the problem you have stated (in the "for instance" paragraph).
Alex
Jul 3 '06 #2
Ah, so separate downloads then. At least now I know.

Ergh... I checked the version of Python my current host is running and its 2.2.

....ergh....

On 7/3/06, Alex Martelli <al***@mac.comwrote:
Python 2.5's standard library includes pysqlite. For any other DB, or
any previous release of Python, you need separate downloads.

Of course, shared hosts that are too lazy (and uninterested in
supporting Python) to perform a 20-seconds download and install, will
hardly be upgrading to Python 2.5 in the next 20 years or so, therefore
I doubt that pysqlite becoming part of the standard library is of any
help to the problem you have stated (in the "for instance" paragraph).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Jul 3 '06 #3
On 7/3/06, Paul McGuire <pt***@austin.rr._bogus_.comwrote:
"Alex Biddle" <he*******@gmail.comwrote in message
news:ma***************************************@pyt hon.org...
Hey, thanks for the reply Jean-Paul.

That's pretty cool knowing that Python 2.5 will have it out of the
box, however what about basic out-of-the-box functionality in 2.4 (or
even older)?

In all my other experiences Python comes with a lot of tools already
available, it seems odd not to have basic database functionality
installed as default.

Would you like a pony with that? pysqlite *is* available today, and is not
overly onerous to install or bundle with your own package. And on the near
horizon, we see that it *will* be part of the included batteries, so
separate installation is only a temporary nuisance.

But there is another database battery available in current Python versions.
Try this:

import bsddb
No SQL support, instead this gives you a dict-like access to the database
(values must be strings, so you have to serialize columns into something
like XML, JSON, YAML, etc.):

import bsddb
db = bsddb.hashopen("testdb.db")
db["Paul"]="""<user name="Paul" id="12345"/>"""
db["Alex"]="""<user name="Alex" id="12346"/>"""
print db.keys()
del db["Paul"]
print db.keys()
db.close()


Thanks for the info. No thanks for the smarmy "pony" comment. I can't
install my own version because I'm on a shared server, of course
ideally I wouldn't like to be.
On 7/3/06, Shane Hathaway <sh***@hathawaymix.orgwrote:
Alex Biddle wrote:
Ah, so separate downloads then. At least now I know.

Ergh... I checked the version of Python my current host is running and its 2.2.

...ergh....

This is why you really want a VPS (virtual private server). The cost is
similar to a web host but you get to choose your own technologies and
versions. Several companies come to mind:

http://westhost.com/
http://jvds.com/
http://linode.com/

I'm using Westhost, which provides Python 2.2 if you ask for it, but I
compiled Python 2.4 instead. I didn't even have to ask whether I was
allowed to do that. :-)

Shane

Yeah, ideally a VPS would be the way to go. In the US hosting seems to
be cheaper than here in the UK, I don't know why. If I was going to
make a Python web app then I would go VPS, nowadays though I just make
do with PHP.
On 3 Jul 2006 09:45:35 -0700, BartlebyScrivener <rp*******@gmail.comwrote:
I guess you looked here without finding what you want?

http://www.python.org/doc/topics/database/

What's the big deal with "out of the box"? People have different tastes
in dbs and ways to access them, why not just pick the one you want and
download it?

You didn't say if you are on Linux or Windows. The ODBC module comes
with PythonWin. Others have good luck with mxODBC, which works right
out of the box after you download and install it.
The big deal with "out of the box" is that if it had support from the
outset for MySQL then Python could appeal to the mass market of people
who go for cheap-o hosts that can't be bothered to upgrade Python let
alone install databasefoo support. Currently this market is more or
less solely occupied by PHP.

Yes... I have installed MySQL support etc. on my local Linux server
but I /can't/ do that on a shared hosting environment.
Searching the group will tell you all you need to know on this topic,
as it comes up twice a week.
For what it's worth, I did try searching, but I guess my parametres
were the wrong ones. If it comes up twice a week, perhaps its a case
of demand and supply anyway?
Jul 3 '06 #4
Thanks for the info. No thanks for the smarmy "pony" comment.

Do you really want "smarmy" here? I don't think it works. Don't you
mean "flip" or "smart-alecky" or "facetious"?

Websters 3rd Unabridged
Main Entry:smarmy
Function:adjective
Inflected Form:-er/-est

1 : SLEEK *smarmy-headed David Walker*
2 : unctuously or fulsomely flattering : SLOBBERY, GUSHING, OILY,
INSINUATING "young man with the smarmy voice"--Noel Coward; "coy and
smarmy"-- Bernard Hollowood; "smarmy insincerity" Eric Partridge; "a
smarmy little melody"--Time

rd

Jul 4 '06 #5
BartlebyScrivener wrote:
Thanks for the info. No thanks for the smarmy "pony" comment.

Do you really want "smarmy" here? I don't think it works. Don't you
mean "flip" or "smart-alecky" or "facetious"?
Hmm. I think the word we're looking for here is "snarky". ;-)

Although, I confess to ignorance on what a "snark" is or whether
it is particularly known for brief self-consciously clever sarcastic
responses.

I sympathize with the shared-hosting problem, that's a major pain.
I would say 'go find a virtual private hosting service', but my
batting average is not so good with actual companies on that. I had
one that was pretty decent, but then went out of business and now
I'm with one that has rather poor-to-mediocre support and has been
extraordinarily slow ("VPSLand", BTW). I don't suppose anyone has
better options? I was looking for somebody that would let me run
Debian on a VPS.

Cheers,
Terry

--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jul 4 '06 #6
Terry Hancock <ha*****@anansispaceworks.comwrote:
...
Although, I confess to ignorance on what a "snark" is or whether
http://www.gutenberg.org/etext/13
Alex
Jul 4 '06 #7
Alex Martelli wrote:
http://www.gutenberg.org/etext/13
Leave it to the guy who can quote Borges and The Celestial Emporium of
Benevolent Knowledge while explaining multiple inheritance.

See Cookbook 2nd Ed pg. 234

Jul 4 '06 #8
BartlebyScrivener <rp*******@gmail.comwrote:
Alex Martelli wrote:
http://www.gutenberg.org/etext/13

Leave it to the guy who can quote Borges and The Celestial Emporium of
Benevolent Knowledge while explaining multiple inheritance.

See Cookbook 2nd Ed pg. 234
<bow>...;-)
Alex
Jul 4 '06 #9
Do you really want "smarmy" here? I don't think it works. Don't you
mean "flip" or "smart-alecky" or "facetious"?

Hmm. I think the word we're looking for here is "snarky". ;-)

Although, I confess to ignorance on what a "snark" is or whether
it is particularly known for brief self-consciously clever sarcastic
responses.

I sympathize with the shared-hosting problem, that's a major pain.
I would say 'go find a virtual private hosting service', but my
batting average is not so good with actual companies on that. I had
one that was pretty decent, but then went out of business and now
I'm with one that has rather poor-to-mediocre support and has been
extraordinarily slow ("VPSLand", BTW). I don't suppose anyone has
better options? I was looking for somebody that would let me run
Debian on a VPS.

Cheers,
Terry
Thanks for the considerate reply, it is annoying being stuck on a
shared server.
Thanks for the info. No thanks for the smarmy "pony" comment.

Do you really want "smarmy" here? I don't think it works. Don't you
mean "flip" or "smart-alecky" or "facetious"?
>From some Internet dictionary:
Smarmy:
1. Hypocritically, complacently, or effusively earnest; unctuous. See
Synonyms at unctuous.
2. Sleek.

I was aiming specifically towards the "effusively earnest" I don't
think that's a bad word to describe "would you like a pony with that
too?"

Anyway, the first time I read replies to my message I chuckled. It's
like the stereotypical intellectual debate, if you don't like the
message then focus on the detail.

The message in this case was that I /couldn't/ install anything by
myself as it is on a /shared/ server that's why I wanted to know
whether there was anything out of the box I could use.

Of course I would install all the "ponies" I wanted given I had proper
privileges to the machine.
Jul 4 '06 #10
Alex Biddle wrote:
The message in this case was that I /couldn't/ install anything by
myself as it is on a /shared/ server that's why I wanted to know
whether there was anything out of the box I could use.
but you did search the library reference TOC and/or the index for "database" before
you posted, and found that the "persistent dictionary" stuff in there weren't databasish
enough, right ?

</F>

Jul 4 '06 #11
Yes, I searched but couldn't find anything. Maybe I wasn't searching
for the right things / in the right places.

I admit I'm more used to forums than mailing lists, but I always make
some effort to search.

On 7/4/06, Fredrik Lundh <fr*****@pythonware.comwrote:
but you did search the library reference TOC and/or the index for "database" before
you posted, and found that the "persistent dictionary" stuff in there weren't databasish
enough, right ?
Jul 4 '06 #12
Alex Martelli wrote:
Terry Hancock <ha*****@anansispaceworks.comwrote: ...
Although, I confess to ignorance on what a "snark" is or whether

http://www.gutenberg.org/etext/13
"The Hunting of the Snark" by Lewis Caroll

Of course! I've heard of it, but never read it. Thanks, Alex. :-)

Not sure if it's relevant, yet, but no doubt I will be edified by
the experience in any case. I've enjoyed everything else by
Caroll that I've read.

Cheers,
Terry

--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jul 4 '06 #13
In article <ma***************************************@python. org>,
Terry Hancock <ha*****@anansispaceworks.comwrote:
>
I sympathize with the shared-hosting problem, that's a major pain. I
would say 'go find a virtual private hosting service', but my batting
average is not so good with actual companies on that. I had one that
was pretty decent, but then went out of business and now I'm with one
that has rather poor-to-mediocre support and has been extraordinarily
slow ("VPSLand", BTW). I don't suppose anyone has better options? I
was looking for somebody that would let me run Debian on a VPS.
http://www.panix.com/corp/virtuals/vservers.html

Unfortunately, it's not being as well advertised as it should be, but
Panix is definitely one of the class operators.
--
Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there." --Steve Gonedes
Jul 6 '06 #14

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

Similar topics

1
by: R Camarda | last post by:
Help, I have a database that has a data file of 2GB and a log file of 31GB. In enterprise manager, when I choose shrink it says there is 30GB of unused space. When I shrink the database, it does...
0
by: Sean Powell | last post by:
I am a SQL Server DBA Manager and my employer (Symantec) will be opening a position in the near future (20-60 days) for my DBA team. Here is the job description:...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
8
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
13
by: TS | last post by:
Say i have a class car with properties: Color, Make, Model, Year, DriverID And a Driver class with properties: DriverID, Name The driverID PRIVATE property is the id of the driver from say a...
5
by: igotyourdotnet | last post by:
I'm trying to add a web part to my page and when I run my page with the web part I get this error: An error has occurred while establishing a connection to the server. When connecting to SQL...
2
by: steve | last post by:
Hi All I need to learn how to update a SQl server or Access database located on a web server from my windows forms application, via the internet I have a customer who wants to run several...
7
by: =?Utf-8?B?TWF4R3J1dmVu?= | last post by:
I have a DLL that implements the Business and Data Layers for a number of different websites. That DLL uses a Strongly Typed DataSet to interface to the Data Source which is SQL Server. There...
9
by: =?Utf-8?B?TUNN?= | last post by:
I'm sure the answer to my question varies depending on the situation, but I am looking for a general "best practice". If I have an asp.net application and I load certain data from a database,...
0
by: sam | last post by:
Hi, Hope you are doing well !!!! One of our clients is looking to augment their team with “Database Architect – DB2" please find below the details and respond with
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.