Excel database module

G

Garret McGraw

Has anybody heard of or know of a python module for
reading/parsing/writing microsoft excel databases?
Any response would be greatly appreciated.

Thanks,
GEM
 
D

Dennis Lee Bieber

Has anybody heard of or know of a python module for
reading/parsing/writing microsoft excel databases?
Any response would be greatly appreciated.
Assuming this is meant to run on a Windows system that also has
Excel installed, the common view is: let Excel do the work -- ie, use
the win32 python extensions to access the Excel system as a COM object
(hope I have the proper terminology -- I've not done it).

--
 
B

Brian Kelley

I have not found a good reader yet, although there is a capable writer here:

http://sourceforge.net/projects/pyxlwriter/

There is a perl module that can read and write excel documents that this
package is based on.

If you follow the COM route, do your self a favor and pick up a copy of
Python Win32 Programming.

Brian
 
C

Cy Edmunds

Garret McGraw said:
Has anybody heard of or know of a python module for
reading/parsing/writing microsoft excel databases?
Any response would be greatly appreciated.

Thanks,
GEM

If you really mean "database" you can do whatever you like using odbc. Fire
up your Data Sources program (under Control Panel/Administrative Tools in
XP) and do an Add/Microsoft Excel Driver. You will have to browse for the
Excel file and give the connection a name. Let's say you pick "Melvin". Then
in Python:

import odbc
import dbi
dbc = odbc.odbc("Melvin")
crsr = dbc.cursor()
sql = "select foo from bar;"
crsr.execute(sql)
print crsr.fetchone()
dbc.close()

"bar" is a named range in the workbook which contains column headings, one
of which is "foo". If it looks like:

foo baz bref
2 3 5
7 9 1

your program will print out:

(2,)

How well does all this work in practice? No idea. I just tried it for the
first time and all I can say is it worked OK for my trivial example.
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top