deirokay.parser.treaters.builtin.integer_treater.IntegerTreater
- class deirokay.parser.treaters.builtin.integer_treater.IntegerTreater(thousand_sep: Optional[str] = None, **kwargs)[source]
Bases:
NumericTreaterTreater for integer variables
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.
Create a Deirokay-compatible serializable object that can be serialized (in JSON or YAML formats) and parsed back by Deirokay treaters.
Treat a raw Series to match data expectations for parsing and formatting.
Attributes
Backends supported by this resource.
DType treated by this treater.
List of primitives supported by this treater.
- DISPLAY_DUPL_INDICES_LIMIT = 10
- DISPLAY_NULL_INDICES_LIMIT = 30
- __call__(series: DeirokayDataSeries) DeirokayDataSeries
Proxy for treat.
- 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.
- 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.
- static serialize(series: DeirokayDataSeries) Dict[Literal['values', 'parser'], Union[List, Dict]]
Create a Deirokay-compatible serializable object that can be serialized (in JSON or YAML formats) and parsed back by Deirokay treaters. This method is useful when generating validation documents that embed Deirokay-compatible user data. The output format is a Python dict containing two keys: - values: list of values as Python object. - parser: Deirokay options to parse the data. (See more: deirokay.parser.get_treater_instance).
- Parameters
series (DeirokayDataSeries) – Series data to be serialized.
- Returns
A Python dict containing the keys values and parser.
- Return type
dict
- supported_backends: List[Backend] = [<Backend.PANDAS: 'pandas'>, <Backend.DASK: 'dask'>]
Backends supported by this resource.
- Type
List[Backend]
- supported_primitives: List[Any] = []
List of primitives supported by this treater.
- Type
List[Any]
- treat(series: Iterable) DeirokayDataSeries
Treat a raw Series to match data expectations for parsing and formatting.
Calls the appropriate method for the detected backend
- Parameters
series (Iterable) – Raw series to be treated.