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

A generic registry interface for keeping track of objects by either string or
integer identifier.

 
Package Contents
       
bool
item
name

 
Classes
       
runtimepy.schemas.RuntimepyDictCodec(vcorelib.dict.codec.DictCodec)
Registry(runtimepy.schemas.RuntimepyDictCodec, typing.Generic)
typing.Generic(builtins.object)
Registry(runtimepy.schemas.RuntimepyDictCodec, typing.Generic)

 
class Registry(runtimepy.schemas.RuntimepyDictCodec, typing.Generic)
    Registry(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 base class for a generic registry.
 
 
Method resolution order:
Registry
runtimepy.schemas.RuntimepyDictCodec
vcorelib.dict.codec.DictCodec
vcorelib.dict.codec.JsonCodec
abc.ABC
vcorelib.schemas.mixins.SchemaMixin
typing.Generic
builtins.object

Methods defined here:
__getitem__(self, key: Union[str, int]) -> ~T
Get a registry item.
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]]]]
Get this registry as a dictionary.
get(self, key: Union[str, int]) -> Optional[~T]
Attempt to get an item from a registry key.
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(self, name: str, item: ~T) -> bool
Attempt to register a new item.
register_dict(self, name: str, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]) -> Optional[~T]
Register a new item from dictionary data.
search(self, pattern: str, exact: bool = False) -> Iterator[tuple[str, ~T]]
Search for items in the registry by name.

Readonly properties defined here:
kind
Determine what kind of registry this is.

Data and other attributes defined here:
__abstractmethods__ = frozenset({'kind'})
__annotations__ = {'name_registry': type[runtimepy.registry.name.NameRegistry]}
__orig_bases__ = (<class 'runtimepy.schemas.RuntimepyDictCodec'>, typing.Generic[~T])
__parameters__ = (~T,)
name_registry = <class 'runtimepy.registry.name.NameRegistry'>
A simple class for keeping track of name-to-identifier mappings.

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

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.
__eq__(self, other) -> bool
Determine if this instance is equal to another.
__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 0x7f6c7af8b8c0>, **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 0x7f6c7af8b8c0>, 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 0x7f6c7af8b8c0>, 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

Data and other attributes inherited from vcorelib.dict.codec.JsonCodec:
__hash__ = None

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.

Class methods inherited from typing.Generic:
__class_getitem__(...) from abc.ABCMeta
Parameterizes a generic class.
 
At least, parameterizing a generic class is the *main* thing this
method does. For example, for some generic class `Foo`, this is called
when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.
 
However, note that this method is also called when defining generic
classes in the first place with `class Foo[T]: ...`.
__init_subclass__(...) from abc.ABCMeta
Function to initialize subclasses.

 
Data
        Iterator = typing.Iterator
T = ~T