PyDocs

Python Language Services

pickletools

"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
Symbols in pickletools

d

dis
Produce a symbolic disassembly of a pickle.

g

genops
Generate all the opcodes in a pickle.

o

optimize
Optimize a pickle string by removing unused PUT opcodes