Readable Persistance?

David Bolen db3l at
Mon Jun 21 22:13:11 CEST 2004

"Chris S." <chrisks at> writes:

> I'm trying to write programs that make use of a lot of dynamic
> structures. To aid in debugging and data extraction, I'd like to
> persist these objects in a form that's readable, but one that also
> preserves handles (ie for lambda expressions, dictionaries, lists,
> etc).

Can you clarify what you might mean by "debugging and data extraction"?

The reason I ask is that if you're primarily concerned with the
ability to access the data easily outside of the program that
generated it, then have you considered just interatively loading your
picking file and performing whatever manipulations you might want?

That is, if pickle satisfies your need for the persistence of the data
structures themselves, perhaps the readability of the raw pickle file
need not be a problem if you consider just using Python to load that
file in when you need to examine it.  You could always interactively
(or with small scripts if you do repetitive operations) then dump
selected portions of the data to more parseable flat text files for
use with other tools if necessary, while not losing any of the
richness of the original data structure.

I know that I've done this numerous times in the past (both with
pickle files as well as with ZODB databases) as a way to examine
stored program state in an interactive manner outside of the original

-- David

More information about the Python-list mailing list