compressed serialization module

skip at pobox.com skip at pobox.com
Mon Nov 17 13:23:06 EST 2008


    >> I used pickle and found the file was saved in text format.  I wonder
    >> whether anyone is familiar with a good compact off-the-shelf module
    >> available that will save in compressed format... or maybe an opinion
    >> on a smart approach for making a custom one?

    Joe> Well, here's a thought: create a zip file (using the standard
    Joe> zipfile module), and pickle your data into that.

Also, specify a pickle binary protool.  Here's a silly example:

    >>> len(pickle.dumps([1,2,3], pickle.HIGHEST_PROTOCOL))
    14
    >>> len(pickle.dumps([1,2,3], 0))
    18

Skip



More information about the Python-list mailing list