lightweight embedded database table object

Brian Schmidt noreply at antispam.com
Mon Apr 3 14:42:25 EDT 2000


> I am trying to find or build a small python database for a deeply embedded
> Python application, that runs on an embedded piece of hardware we're
> developing. The hardware is
> basically PC compatible, and runs an embedded realtime operating system.
> Python runs great on it, but I have to have ALL C modules statically
linked
> in.

Hi Warren,
Have you looked at MetaKit? http://www.equi4.com/metakit/python.html

"Warren Postma" <embed at geocities.com> wrote in message
news:sS4G4.2894$HG1.86777 at nnrp1.uunet.ca...
>
> I am trying to find or build a small python database for a deeply embedded
> Python application, that runs on an embedded piece of hardware we're
> developing. The hardware is
> basically PC compatible, and runs an embedded realtime operating system.
> Python runs great on it, but I have to have ALL C modules statically
linked
> in.
>
> I have attached some sample code to show the sorts of things I'm trying to
> do.  The performance of the pure-python isn't great, I'd rather use a
> compiled C python module
> that did similar things. Has anyone written one.
>
> I've looked at Gadfly, and since Gadfly can consume loads of RAM, it's not
> exactly ideal for me. I don't really need an SQL grammar, but if it
weren't
> for the RAM issue, I'd consider it.
>
> The lwdb module I've attached uses BSDDB v2 as the disk-based
> store-and-retrieve method.
>
> It adds ascii-delimited (CSV) import and export features (not well tested
> yet), and a trivial assortment of types (say, float, string and integer
for
> now, but I'll be adding others like datetime fields, etc).
>
> I'd like an ultra-compact binary storage method and maybe even a very-fast
> compression method, and I'm thinking of adding support for the "ROTOR"
> builtin Python module, so that the database store can be somewhat
"opaque".
> I will be storing user names and passwords in there, so I'll probably want
> to add some encryption.
>
> Perhaps all those things I can do with Python plus a little marshalling or
> pickling are worth the overhead of a BSDDB file, which seems to use about
> 200K of disk space for every 100K of data in the variable-length-record
> field.
>
> I've considered things like dBase files, but they are such a crusty old
> standard, really.  If I had to go that way, I would buy Codebase from
> Sequiter Software, and whip up a C to Python interface to them. Anyone
else
> done any Python+Codebase work?
>
> I don't really need wicked-fast lookup on disk. I'm wondering if I should
> just invent my own C module to do this job.  Then again, I could be very
> foolish, as any "database" code you write ends up always being more
> complicated than you originally thought.
>
> Warren Postma
>
> ----
>
> attached sample code:
>      lwdb.py - lightweight database table object (stores in a bsd
database)
>      lwdbrec.py - lightweight database record object (primitive
> typed-database-'tuple')
>
> [I have no idea of attachments bounce from the mailing list or newsgroup,
or
> if they considered In Bad Taste, but as they are small, I'm going ahead
> anyways....]
>
>
>
>
>
>





More information about the Python-list mailing list