473,288 Members | 1,705 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,288 software developers and data experts.

Database and Interface for Python

I'm writing a couple of modules that store information about user
'behaviour'. E.g. a user accesses a certain page of a website at a
certain date-time with a certain referrer.

I need to analyse this information by different criteria. E.g. How
many users accessed the website between August 5th and August 12th,
listed by refferer !! etc It would be great to have a database engine
where I could ask these questions in just a couple of queries, rather
than having to implement all the sort/analyse functions myself.

I guess this is as bad a time as anyto start to learn to use a
database !! So I look on google and the situation is a little unclear.
I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
MySQL. Not only that but I need a python interface to that engine that
the database API can use ? (or I can just directly use the python
binding for whichever database I pick ?).

I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....
Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?

Regards,
Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Jul 18 '05 #1
6 1627
Michael Foord wrote:
I'm writing a couple of modules that store information about user
'behaviour'. E.g. a user accesses a certain page of a website at a
certain date-time with a certain referrer.

I need to analyse this information by different criteria. E.g. How
many users accessed the website between August 5th and August 12th,
listed by refferer !! etc It would be great to have a database engine
where I could ask these questions in just a couple of queries, rather
than having to implement all the sort/analyse functions myself.
Yep, databases are fast, reliable and scalable for this.

I guess this is as bad a time as anyto start to learn to use a
database !! So I look on google and the situation is a little unclear.
I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
MySQL. Not only that but I need a python interface to that engine that
the database API can use ? (or I can just directly use the python
binding for whichever database I pick ?).
Python has a good DB interface to MySQL that works well.
I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....
Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?
Yes you can. Dates are stored in special format (not text) in the
database that make searching/sorting possible. You can also define
index on a date column and jump directly to a specific date (skipping
all dates you don't want to process) or range of dates.

Regards,
Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html

Jul 18 '05 #2
Michael Foord wrote:
I need to analyse this information by different criteria. E.g. How
many users accessed the website between August 5th and August 12th,
listed by refferer !! etc It would be great to have a database engine
where I could ask these questions in just a couple of queries, rather
than having to implement all the sort/analyse functions myself.
Just simply transfer those your data to database and then retrievieng
detailed information will be simple.
I guess this is as bad a time as anyto start to learn to use a
database !! So I look on google and the situation is a little unclear.
I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
MySQL. Not only that but I need a python interface to that engine that
the database API can use ?
Yes, you will need both database and python interface to access it.

I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....
Webserwer has nothing to do with database.
Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?


Yes.

--
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl
Jul 18 '05 #3
On 7 Oct 2004 15:11:17 -0700, fu******@gmail.com (Michael Foord)
declaimed the following in comp.lang.python:

I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
The "database API" is a specification of what a database
specific interface module should implement for "consistent" access. It
doesn't have a physical existence (you can't "import API").

I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....
MySQLdb is /a/ module that implements the "database API" for
MySQL; there are many other modules that implement the "database API"
for other database engines.

Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?
If you can do one using the command-line mysql client program,
sure... Since all you do in a DB API compliant module is generate a
string of the same SQL used in the command-line....

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #4
[snip..]
I guess this is as bad a time as anyto start to learn to use a
database !! So I look on google and the situation is a little unclear.
I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
MySQL. Not only that but I need a python interface to that engine that
the database API can use ?


Yes, you will need both database and python interface to access it.

I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....


Webserwer has nothing to do with database.


It does if it's a 'web application' your developing !! Whatever
solution I choose has to work on my server *and* on my windoze nox for
testing !!

Thanks for your answer though.

Regards,

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?


Yes.

Jul 18 '05 #5
[snip..]
I guess this is as bad a time as anyto start to learn to use a
database !! So I look on google and the situation is a little unclear.
I can use the database API that will give me a 'consistent
interface'... but I still need a database engine installed. e.g.
MySQL. Not only that but I need a python interface to that engine that
the database API can use ? (or I can just directly use the python
binding for whichever database I pick ?).


Python has a good DB interface to MySQL that works well.

Am I right in thinking that is the MySQLdb python interface at
http://sourceforge.net/projects/mysql-python

This supports versions of MySQL up to 4.0.... ??

Thanks for your help.
Regards,
Fuzzy

I think the web server I use will allow MySQL databases, so if I
install it on my windoze box and install the MySQLdb python module
then I'm well away....
Have I got it right ? Can I do 'date range' queries using MySQL,
MySQLdb and the Python database API ?


Yes you can. Dates are stored in special format (not text) in the
database that make searching/sorting possible. You can also define
index on a date column and jump directly to a specific date (skipping
all dates you don't want to process) or range of dates.

Regards,
Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html

Jul 18 '05 #6
Michael Foord wrote:

> I think the web server I use will allow MySQL databases, so if I
> install it on my windoze box and install the MySQLdb python module
> then I'm well away....


Webserwer has nothing to do with database.


It does if it's a 'web application' your developing !! Whatever
solution I choose has to work on my server *and* on my windoze nox for
testing !!


You can use (almost) any web server with any database, they are separate
components (except few non-popular integrated solutions), so your web
server will allow you to use mysql.

--
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl
Jul 18 '05 #7

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

Similar topics

5
by: john | last post by:
Hi I am devlopeing a data centric intranetsite with data in mysql database I would like your opinion on this architecture Data will be fetched from database by python & converted into xml The...
23
by: ajikoe | last post by:
Hello I need to build table which need searching data which needs more power then dictionary or list in python, can anyone help me what kind of database suitable for python light and easy to learn....
6
by: Wolfgang Keller | last post by:
Hello, I'm looking for a spreadsheet application (MacOS X prefered, but Windows, Linux ar available as well) with support for Python scripting (third-party "plug-ins" are ok) and a database...
2
by: Moishy Gluck | last post by:
How do I open a mysql database with python. I nead a module that is compatible with windows, and will be on any regular server I singup with. if you could give me some documentation on the module...
0
by: viv.mee | last post by:
Hi, Could anybody tell me how to connect to a microsoft Access database using Python? Quick sample of code would help .. much appreciated..Thanks viv
2
by: GinTon | last post by:
EyeDB is a free ODBMS based on the ODMG 3 specification with programming interfaces for C++ and Java. It is very powerfull, mature, safe and stable. In fact, it was developed in 1992 for the Genome...
8
by: Abandoned | last post by:
Hi. I want to copy my database but python give me error when i use this command. cursor.execute("pg_dump mydata old.dump") What is the problem ? And how can i copy the database with python ?...
1
by: rsdcbabu | last post by:
hi all, Is there any interface which could return data from postgresql to python as objects so that the features of the resulting data is unchanged. for eg: returning 'date' from postgres to...
0
by: Terry Reedy | last post by:
FYI I initially parsed the subject line as "eGenix mxODBC - ODBC Database Interface" for "Python 3.0.2" and thought, "Wow, already prepared for the future" (6 months to a year) ;-). tjr
0
by: eGenix Team: M.-A. Lemburg | last post by:
On 2008-10-15 20:30, Terry Reedy wrote: It's going to look even better when we release version 4.0 in a year or so ;-) FWIW, we're still waiting for the dust to settle before going for a Py3k...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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.