fleche.storage.pickle_file ========================== .. py:module:: fleche.storage.pickle_file Attributes ---------- .. autoapisummary:: fleche.storage.pickle_file.logger Classes ------- .. autoapisummary:: fleche.storage.pickle_file.PickleFileBackend fleche.storage.pickle_file.ValuePickleFile fleche.storage.pickle_file.CallPickleFile Module Contents --------------- .. py:data:: logger .. py:class:: PickleFileBackend Bases: :py:obj:`fleche.storage.file.FileStorage` Store values as files on the filesystem using a serialization module. .. py:attribute:: secret_key :type: list[bytes] :value: [] .. py:attribute:: dumps :type: Callable .. py:attribute:: loads :type: Callable .. py:attribute:: compress :type: bool :value: False .. py:method:: __post_init__() .. py:method:: with_pickle(*args, **kwargs) :classmethod: Construct a PickleFileBackend using the standard pickle module. .. py:method:: with_cloudpickle(*args, **kwargs) :classmethod: Construct a PickleFileBackend using the cloudpickle module. .. py:method:: with_dill(*args, **kwargs) :classmethod: Construct a PickleFileBackend using the dill module. .. py:method:: _to_file(value: Any, path: pathlib.Path) -> None .. py:method:: _from_file(path: pathlib.Path) -> Any .. py:class:: ValuePickleFile Bases: :py:obj:`fleche.storage.base.ValueMixin`, :py:obj:`fleche.storage.destructuring.DestructuringMixin`, :py:obj:`PickleFileBackend` Bridges :class:`ValueStorage` with :class:`StorageBackend` primitives. Implements ``save`` and ``load`` using ``put`` and ``get``. Concrete classes inherit from this and a :class:`StorageBackend` implementation to get a fully functional value storage. .. py:class:: CallPickleFile Bases: :py:obj:`fleche.storage.base.CallMixin`, :py:obj:`PickleFileBackend` Bridges :class:`CallStorage` with :class:`StorageBackend` primitives. Implements ``save``, ``load``, and ``query`` using ``put`` and ``get``, deriving the storage key from the call's lookup key. ``transform`` is inherited from :class:`CallStorage`. Concrete classes inherit from this and a :class:`StorageBackend` implementation to get a fully functional call storage.