views:

2379

answers:

4

I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.

Update: Thanks @cnu, I used Yusdi Santoso's dbf.py and it works nicely. One gotcha: The memo file name extension must be lower case, i.e. .fpt, not .FPT which was how the filename came over from Windows.

+3  A: 

You can try this recipe on Active State.

There is also a DBFReader module which you can try.

For support for memo fields.

cnu
+4  A: 

I prefer dbfpy. It supports both reading and writing of .DBF files and can cope with most variations of the format. It's the only implementation I have found that could both read and write the legacy DBF files of some older systems I have worked with.

Anders Sandvig
+3  A: 

If you're still checking this, I have a GPL FoxPro-to-PostgreSQL converter at http://honeypot.net/project/pgdbf . We use it to routinely copy our tables into PostgreSQL for fast reporting.

Just Some Guy
A: 

Check out http://groups.google.com/group/python-dbase

It currently supports dBase III and Visual Foxpro 6.0 db files... not sure if the file layout change in VFP 9 or not...