anyconfig.backend.pickle

Pickle backend:

  • Format to support: Pickle
  • Requirements: It should be available always.
  • Development Status :: 4 - Beta
  • Limitations: The parser cannot load some primitive data such like ‘’ (empty string), ‘ ‘ (white space) and [] (empty list) as these are because of the implementation of load_with_fn().
  • Special options: All options of pickle.{load{s,},dump{s,}} should work.

Changelog:

    Changed in version 0.9.7:
  • Add support of loading primitives other than mapping objects.

New in version 0.8.3.

class anyconfig.backend.pickle.Parser

Bases: anyconfig.backend.base.StringStreamFnParser, anyconfig.backend.base.BinaryFilesMixin

Parser for Pickle files.

_type = 'pickle'
_extensions = ['pkl', 'pickle']
_load_opts = []
_dump_opts = ['protocol']
_allow_primitives = True
_load_from_string_fn(**kwargs)

loads(string) – Load a pickle from the given string

_load_from_stream_fn(**kwargs)

load(file) – Load a pickle from the given file

__module__ = 'anyconfig.backend.pickle'
_dump_to_string_fn(**kwargs)

dumps(obj, protocol=0) – Return a string containing an object in pickle format.

See the Pickler docstring for the meaning of optional argument proto.

_dump_to_stream_fn(**kwargs)

dump(obj, file, protocol=0) – Write an object in pickle format to the given file.

See the Pickler docstring for the meaning of optional argument proto.