fleche.storage.pickle_file

Attributes

logger

Classes

PickleFileBackend

Store values as files on the filesystem using a serialization module.

ValuePickleFile

Bridges ValueStorage with StorageBackend primitives.

CallPickleFile

Bridges CallStorage with StorageBackend primitives.

Module Contents

fleche.storage.pickle_file.logger[source]
class fleche.storage.pickle_file.PickleFileBackend[source]

Bases: fleche.storage.file.FileStorage

Store values as files on the filesystem using a serialization module.

secret_key: list[bytes] = [][source]
dumps: Callable[source]
loads: Callable[source]
compress: bool = False[source]
__post_init__()[source]
classmethod with_pickle(*args, **kwargs)[source]

Construct a PickleFileBackend using the standard pickle module.

classmethod with_cloudpickle(*args, **kwargs)[source]

Construct a PickleFileBackend using the cloudpickle module.

classmethod with_dill(*args, **kwargs)[source]

Construct a PickleFileBackend using the dill module.

_to_file(value: Any, path: pathlib.Path) None[source]
_from_file(path: pathlib.Path) Any[source]
class fleche.storage.pickle_file.ValuePickleFile[source]

Bases: fleche.storage.base.ValueMixin, fleche.storage.destructuring.DestructuringMixin, PickleFileBackend

Bridges ValueStorage with StorageBackend primitives.

Implements save and load using put and get. Concrete classes inherit from this and a StorageBackend implementation to get a fully functional value storage.

class fleche.storage.pickle_file.CallPickleFile[source]

Bases: fleche.storage.base.CallMixin, PickleFileBackend

Bridges CallStorage with 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 CallStorage.

Concrete classes inherit from this and a StorageBackend implementation to get a fully functional call storage.