Python module for Dbase files?

Stephen Hansen stephen at cerebralmaelstrom.com
Thu Jun 22 05:24:51 EDT 2000


I have absolutely *no* idea if it will run with Python 1.2, or under DOS,
but when I was looking for database support awhile back, someone pointed me
to MetaKit, and I absolutely *love* it...

http://www.equi4.com/metakit/

Creating a database is as easy as...

>>> import Mk4py
>>> mk = Mk4py # Done for ease-of-typing!

>>> db = mk.Storage("filename.mk",1)
>>> table =
db.getas("mytable[StringField1:S,IntField1:I,StringField2:S,BLOBField:B]")
>>> table.append(StringField1='This is a string',IntField1 = 2,StringField2
= 'Lalala',BLOBField = 'Binary data stored here :P')
>>> table[0].StringField1
'This is a string'

You use the 'getas' to dynamically create, or alter, the structure of the
database/table/view... later, if you don't want to change the structure, you
can just use "db.view('name')".

--S



William Dandreta <wjdandreta at worldnet.att.net> wrote in message
news:Uw945.16309$Xx5.881927 at bgtnsc06-news.ops.worldnet.att.net...
> Hi Anders,
>
> >Do you REALLY need to use dBASE? Are you interacting with some other
> >programs that uses the same database?
>
>
> I don't really need to use Dbase but I need something that works with DOS
> and is platform independent.
>
> I found XBase which is an open source C++ database library that uses dbase
> data structures and is platform independent. If Python does not already
have
> Dbase access, I guess I will have to figure out how to put a Python
wrapper
> around Xbase.
>
> >Maybe you could use SWIG to create a Python module for using it.
> >If you're not in a hurry I could maybe do it, but not until late
> >august.
>
> What is SWIG?
>
> >// Anders
> >
>
>





More information about the Python-list mailing list