shelve in a ZipFile?
hancock at anansispaceworks.com
Sat Jul 2 23:23:06 CEST 2005
On Friday 01 July 2005 04:40 pm, Andreas Kostyrka wrote:
> It's even worse: shelve is basically a class that wraps a dictionary. It
> provides a dictionary string -> pickable object based on a dictioary
> string -> string. bsddb, gdbm etc. probably access files via lowlevel
> calls that are not interceptable.
> One way to achieve your goals would be to add compression and/or a key
> prefix (which would allow multiple dictionaries or at least key spaces
> in one file)
Yeah, I'm already using a character prefix for header data in the
1st file. Right now, one of the headers tells where to find the 2nd file.
Seems to be working okay.
I'm a little bothered by the idea of lumping both into one dictionary,
though I see this could be done the same way.
I wasn't really looking for a way to compress the data (just thought it
was a nice side benefit), but your post reminded me that I could do
it with zlib on the data *before* storing them in the shelf. I guess if
bulk becomes an issue I'll try that.
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
More information about the Python-list