Simulation Results Managment

rusi rustompmody at gmail.com
Sun Jul 15 18:20:34 CEST 2012


On Jul 15, 11:35 am, Dieter Maurer <die... at handshake.de> wrote:
> moo... at yahoo.co.uk writes:
> > ...
> > Does pickle have any advantages over json/yaml?
>
> It can store and retrieve almost any Python object with almost no effort.
>
> Up to you whether you see it as an advantage to be able to store
> objects rather than (almost) pure data with a rather limited type set.
>
> Of course, "pickle" is a proprietary Python format. Not so easy to
> decode it with something else than Python. In addition, when
> you store objects, the retrieving application must know the classes
> of those objects -- and its knowledge should not be too different
> from how those classes looked when the objects have been stored.
>
> I like very much to work with objects (rather than with pure data).
> Therefore, I use "pickle" when I know that the storing and retrieving
> applications all use Python. I use pure (and restricted) data formats
> when non Python applications come into play.

Pickle -> JSON -> Yaml
are roughly in increasing order of human-friendliness and decreasing
order of machine friendliness (where machine means python 'machine')

This means that
 - Pickle is most efficient, Yaml least
 - Pickle comes with python from as far back as I know
   Json started coming somewhere round 2.5 (I think)
   (py)yaml needs to be installed separately
 - reading pickled data will spoil your eyes whereas yaml is pleasant
to read (just like python)




More information about the Python-list mailing list