runtimepy.enum
index
/home/vkottler/src/vkottler/workspace/runtimepy/runtimepy/enum/__init__.py

A module implementing a runtime enumeration interface.

 
Package Contents
       
registry
types

 
Classes
       
runtimepy.registry.item.RegistryItem(runtimepy.schemas.RuntimepyDictCodec)
RuntimeEnum

 
class RuntimeEnum(runtimepy.registry.item.RegistryItem)
    RuntimeEnum(data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
 
A class implementing a runtime enumeration.
 
 
Method resolution order:
RuntimeEnum
runtimepy.registry.item.RegistryItem
runtimepy.schemas.RuntimepyDictCodec
vcorelib.dict.codec.DictCodec
vcorelib.dict.codec.JsonCodec
abc.ABC
vcorelib.schemas.mixins.SchemaMixin
builtins.object

Methods defined here:
as_bool(self, value: Union[str, bool]) -> Optional[bool]
Attempt to get an enumeration boolean.
as_int(self, value: Union[str, int]) -> Optional[int]
Attempt to get an enumeration integer.
as_str(self, value: Union[str, bool, int]) -> Optional[str]
Attempt to get an enumeration string.
asdict(self) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
Obtain a dictionary representing this instance.
get_bool(self, value: Union[str, bool]) -> bool
Get an enumeration boolean.
get_int(self, value: Union[str, int, bool]) -> int
Get an enumeration integer.
get_str(self, value: Union[str, bool, int]) -> str
Get an enumeration string.
init(self, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]) -> None
Perform implementation-specific initialization.
register_bool(self, name: str, value: bool) -> bool
Register a boolean enumeration.
register_int(self, name: str) -> Optional[int]
Register an integer enumeration.

Static methods defined here:
data_from_enum(enum: type[enum.IntEnum]) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
Get JSON data from an enumeration class.
from_enum(enum: type[enum.IntEnum], identifier: int) -> 'RuntimeEnum'
Create a runtime enumeration from an enum class.

Readonly properties defined here:
bools
Get the underlying boolean enumeration.
ints
Get the underlying integer enumeration.
is_boolean
Determine if this is a boolean enumeration.
is_integer
Determine if this is an integer enumeration.

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Methods inherited from runtimepy.registry.item.RegistryItem:
__eq__(self, other) -> bool
Use the integer identifier to determine equivalence.
__hash__(self) -> int
Get a suitable hash for this registry item.

Data and other attributes inherited from runtimepy.schemas.RuntimepyDictCodec:
default_schemas = {'StructConfig': <vcorelib.schemas.json.JsonSche...chemas.json.JsonSchema object at 0x7f5296019d90>}

Methods inherited from vcorelib.dict.codec.DictCodec:
__init__(self, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
Initialize this instance.

Class methods inherited from vcorelib.dict.codec.DictCodec:
create(data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> ~V from abc.ABCMeta
A factory method to create an instance.

Methods inherited from vcorelib.dict.codec.JsonCodec:
__copy__(self: ~T) -> ~T
Create another instance based on this instance's data.
__str__(self) -> str
Use the dictionary representation of this instance for string
representation.
encode(self, pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7f5296b5be30>, **kwargs) -> Tuple[bool, int]
Encode this object instance to a file.

Class methods inherited from vcorelib.dict.codec.JsonCodec:
decode(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7f5296b5be30>, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True, require_success: bool = True, default_data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, **kwargs) -> ~T from abc.ABCMeta
Decode an object instance from data loaded from a file.
file_cache(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7f5296b5be30>, encode_kwargs: Dict[str, Any] = None, require_success: bool = False, **kwargs) -> Iterator[~T] from abc.ABCMeta
Manage an instance of this class as a disk-backed file.
normalize(data: Union[Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], ~T]) -> ~T from abc.ABCMeta
Ensure that some object is an instance of this class.

Data descriptors inherited from vcorelib.dict.codec.JsonCodec:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Methods inherited from vcorelib.schemas.mixins.SchemaMixin:
validate(self, valid_attr: str = 'data') -> None
Validate an instance attribute based on this instance's schema.

Class methods inherited from vcorelib.schemas.mixins.SchemaMixin:
schema_name() -> str from abc.ABCMeta
A default name for this class's schema.