Excel database module

Discussion in 'Python' started by Garret McGraw, May 9, 2004.

  1. 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
     
    Garret McGraw, May 9, 2004
    #1
    1. Advertising

  2. On Sun, 09 May 2004 18:38:04 -0400, Garret McGraw
    <> 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).

    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Home Page: <http://www.dm.net/~wulfraed/> <
    > Overflow Page: <http://wlfraed.home.netcom.com/> <
     
    Dennis Lee Bieber, May 10, 2004
    #2
    1. Advertising

  3. Garret McGraw

    Brian Kelley Guest

    Dennis Lee Bieber wrote:
    > On Sun, 09 May 2004 18:38:04 -0400, Garret McGraw
    > <> 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
     
    Brian Kelley, May 10, 2004
    #3
  4. 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/Cookbook/Python/Recipe/192914

    Thomas
     
    Thomas Guettler, May 10, 2004
    #4
  5. Garret McGraw

    Cy Edmunds Guest

    "Garret McGraw" <> wrote in message
    news:...
    > 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/
     
    Cy Edmunds, May 11, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmltIEhlYXZleQ==?=

    Excel _WorkBook vs. Excel.Workbook

    =?Utf-8?B?SmltIEhlYXZleQ==?=, Sep 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,652
    Steve C. Orr [MVP, MCSD]
    Sep 29, 2004
  2. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,397
    Carl Prothman [MVP]
    Jan 12, 2005
  3. Maric Michaud
    Replies:
    0
    Views:
    7,196
    Maric Michaud
    Jun 24, 2006
  4. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,541
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  5. Replies:
    0
    Views:
    429
Loading...

Share This Page