runtimepy.registry package#
Submodules#
runtimepy.registry.bool module#
A simple boolean-to-identifier registry interface.
- class runtimepy.registry.bool.BooleanRegistry(mapping: MutableMapping[T, str] = None, reverse: MutableMapping[str, T] = None)[source]#
Bases:
TwoWayNameMapping
[bool
]A simple class for keeping track of boolean-to-identifier mappings.
runtimepy.registry.item module#
A module implementing an interface for items that can belong to registries.
- class runtimepy.registry.item.RegistryItem(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#
Bases:
RuntimepyDictCodec
A class interface for items that can be managed via a registry.
runtimepy.registry.name module#
A simple name-to-identifier registry interface.
- class runtimepy.registry.name.NameRegistry(mapping: MutableMapping[int, str] = None, reverse: MutableMapping[str, int] = None)[source]#
Bases:
TwoWayNameMapping
[int
]A simple class for keeping track of name-to-identifier mappings.
Module contents#
A generic registry interface for keeping track of objects by either string or integer identifier.
- class runtimepy.registry.Registry(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#
Bases:
RuntimepyDictCodec
,Generic
[T
]A base class for a generic registry.
- asdict() dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] [source]#
Get this registry as a dictionary.
- init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None [source]#
Perform implementation-specific initialization.
- abstract property kind: type[T]#
Determine what kind of registry this is.
- name_registry#
alias of
NameRegistry