Skip to content

packages.valory.skills.abstract_round_abci.io_.load

This module contains all the loading operations of the behaviours.

AbstractLoader Objects

class AbstractLoader(ABC)

An abstract Loader class.

load_single_file

@abstractmethod
def load_single_file(path: str) -> SupportedSingleObjectType

Load a single file.

load

def load(path: str, multiple: bool) -> SupportedObjectType

Load one or more files.

Arguments:

  • path: the path to the file to load. If multiple, then the path should be a folder with the files.
  • multiple: whether multiple files are expected to be loaded. The path should be a folder with the files.

Returns:

the loaded file.

JSONLoader Objects

class JSONLoader(AbstractLoader)

A JSON file loader.

load_single_file

def load_single_file(path: str) -> NativelySupportedSingleObjectType

Read a json file.

Arguments:

  • path: the path to retrieve the json file from.

Returns:

the deserialized json file's content.

Loader Objects

class Loader(AbstractLoader)

Class which loads files.

__init__

def __init__(filetype: Optional[Any], custom_loader: CustomLoaderType)

Initialize a Loader.

load_single_file

def load_single_file(path: str) -> SupportedSingleObjectType

Load a single file.

Back to top