By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,985 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,985 IT Pros & Developers. It's quick & easy.

Excel database module

P: n/a
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

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Sun, 09 May 2004 18:38:04 -0400, Garret McGraw
<ga***********@yahoo.com> declaimed the following in comp.lang.python:
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).

-- ================================================== ============ <
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 #2

P: n/a
Dennis Lee Bieber wrote:
On Sun, 09 May 2004 18:38:04 -0400, Garret McGraw
<ga***********@yahoo.com> declaimed the following in comp.lang.python:

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

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

Jul 18 '05 #3

P: n/a
Am Sun, 09 May 2004 18:38:04 -0400 schrieb 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.


Hi,

you can store the files as xml and process this.

Maybe this helps you:
http://aspn.activestate.com/ASPN/Coo.../Recipe/192914

Thomas

Jul 18 '05 #4

P: n/a
"Garret McGraw" <ga***********@yahoo.com> wrote in message
news:ma**************************************@pyth on.org...
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.

--
Cy
http://home.rochester.rr.com/cyhome/
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.