I want to pickle my objects compressed with snappy-python. Because these objects are large I want to use something streaming -- i.e. pickle.dump, not pickle.dumps.
Unfortunately, the snappy and pickle APIs don't seem particularly compatible:
snappy.stream_compress(src, dst, blocksize=65536)
pickle.dump(obj, file, protocol=None)
Any thoughts on what magic I would need for something like snappy.stream_compress(pickle.dump_magic(obj), dst)
to work similarly to what pickle.dump(obj, dst)
does today?