I'm using the
shelve module with gdbm to store Python objects. I understand that shelve
uses pickle
to store the objects. Unfortunately, the sizes of my shelves are too large. I found this solution to bzip2
or gzip
individual pickles. My question is: is there a way to make shelve
compress all its pickles?
Asked
Active
Viewed 676 times
6

Botond
- 2,640
- 6
- 28
- 44
-
if all your files are in the same directory just do `gzip *` from the CLI – gold_cy Dec 31 '18 at 19:08
-
1@aws_apprentice the problem is that I would need to access shelve entries individually. – Botond Dec 31 '18 at 19:09
-
so? it will zip each one separately – gold_cy Dec 31 '18 at 19:19
-
1Shelf is a single file containing many pickled objects. – Botond Dec 31 '18 at 19:30