Loader
amltk.store.loader
#
Module containing the base protocol of a loader.
For concrete implementations based on the key
being
a Path
see the
path_loaders
module.
Loader
#
Bases: ABC
, Generic[KeyT_contra, T]
The base definition of a Loader.
A Loader is a class that can save and load objects to and from a bucket. The Loader is responsible for knowing how to save and load objects of a particular type at a given key.
can_load
abstractmethod
classmethod
#
Return True if this loader supports the resource at key.
This is used to determine which loader to use when loading a resource from a key.
PARAMETER | DESCRIPTION |
---|---|
key |
The key used to identify the resource
TYPE:
|
check |
If the loader can support loading a specific type of object.
TYPE:
|
Source code in src/amltk/store/loader.py
can_save
abstractmethod
classmethod
#
Return True if this loader can save this object.
This is used to determine which loader to use when loading a resource from a key.
PARAMETER | DESCRIPTION |
---|---|
obj |
The object to save.
TYPE:
|
key |
The key used to identify the resource
TYPE:
|
Source code in src/amltk/store/loader.py
load
abstractmethod
classmethod
#
Load an object from the given key.
PARAMETER | DESCRIPTION |
---|---|
key |
The key to load the object from.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
The loaded object. |