deirokay.parser.reader.DataReader
- class deirokay.parser.reader.DataReader[source]
Bases:
MultiBackendMixinHelper class to load data from a data source in function of the backend.
Methods
Generate a subclass that concretizes multibackend backend methods into their intended name.
Get current active backend for this class.
Proxy for register_backend_method to register an existing function as a backend-specific method.
Attributes
Backends supported by this resource.
- classmethod __post_attach_backend__()
This classmethod can be optionally overwritten to serve as a callback function for when the attach_backend() method is called.
- classmethod attach_backend(backend: Backend) Type[_AnyMultiBackendClass]
Generate a subclass that concretizes multibackend backend methods into their intended name. The methods marked with the given backend will compose the returned class.
- Parameters
cls (type) – Class to be subclassed with the given backend.
backend (Backend) – Backend to be selected.
- Returns
Subclass of the current class with methods filtered for the given backend.
- Return type
Type[MultiBackendMixin]
- classmethod get_backend() Backend
Get current active backend for this class.
- Returns
The current active backend.
- Return type
- Raises
InvalidBackend – Backend not set or not a valid execution class.
- read: DeirokayReadCallable
- classmethod register_backend_method(alias_for: str, func: Callable[[...], Any], backend: Backend) None
Proxy for register_backend_method to register an existing function as a backend-specific method.
- Parameters
alias_for (str) – The name of the method to be substituted with a backend-specific version.
func (AnyCallable) – Existing function to be registered as a method.
backend (Backend) – Backend for the method.