runtimepy package#

Subpackages#

Submodules#

runtimepy.app module#

This package’s command-line entry-point application.

runtimepy.app.add_app_args(parser: ArgumentParser) None[source]#

Add application-specific arguments to the command-line parser.

runtimepy.app.entry(args: Namespace) int[source]#

Execute the requested task.

runtimepy.entry module#

This package’s command-line entry-point (boilerplate).

runtimepy.entry.main(argv: List[str] = None) int[source]#

Program entry-point.

runtimepy.mapping module#

A module implementing a generic, two-way mapping interface.

class runtimepy.mapping.TwoWayNameMapping(mapping: MutableMapping[T, str] = None, reverse: MutableMapping[str, T] = None)[source]#

Bases: RegexMixin, LoggerMixin, Generic[T]

A class interface for managing two-way mappings.

asdict() dict[str, T][source]#

Provide a dictionary representation.

classmethod bool_from_dict(data: MutableMapping[str | bool, str | bool]) BoolMapping[source]#

Create a boolean-to-name mapping from a dictionary with arbitrary data.

identifier(key: str | T) T | None[source]#

Get the integer identifier associated with a registry key.

classmethod int_from_dict(data: MutableMapping[str | int, str | int]) IntMapping[source]#

Create an integer-to-name mapping from a dictionary with arbitrary data.

load_key_to_name(mapping: MutableMapping[T, str]) None[source]#

Load a key-to-name mapping.

load_name_to_key(reverse: MutableMapping[str, T]) None[source]#

Load a name-to-key mapping.

name(key: str | T) str | None[source]#

Get the name associated with a registry key.

property names: Iterator[str]#

Iterate over names.

search(pattern: str, exact: bool = False) Iterator[str][source]#

Get names in this mapping based on a pattern.

runtimepy.schemas module#

A module for working with schemas belonging to this package.

class runtimepy.schemas.RuntimepyDictCodec(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: DictCodec

A simple wrapper for package classes that want to implement DictCodec.

default_schemas: SchemaMap | None = {'TaskConfig': <vcorelib.schemas.json.JsonSchema object>, 'RuntimeEnum': <vcorelib.schemas.json.JsonSchema object>, 'EnumRegistry': <vcorelib.schemas.json.JsonSchema object>, 'BitFields': <vcorelib.schemas.json.JsonSchema object>, 'StructConfig': <vcorelib.schemas.json.JsonSchema object>, 'ChannelCommand': <vcorelib.schemas.json.JsonSchema object>, 'PeerProcessConfig': <vcorelib.schemas.json.JsonSchema object>, 'FindFile': <vcorelib.schemas.json.JsonSchema object>, 'ChannelRegistry': <vcorelib.schemas.json.JsonSchema object>, 'has_request_flag': <vcorelib.schemas.json.JsonSchema object>, 'ConnectionArbiterConfig': <vcorelib.schemas.json.JsonSchema object>, 'ServerConnectionConfig': <vcorelib.schemas.json.JsonSchema object>, 'ClientConnectionConfig': <vcorelib.schemas.json.JsonSchema object>, 'has_config': <vcorelib.schemas.json.JsonSchema object>, 'has_factory': <vcorelib.schemas.json.JsonSchema object>, 'channel_controls': <vcorelib.schemas.json.JsonSchema object>, 'has_name': <vcorelib.schemas.json.JsonSchema object>, 'Channel': <vcorelib.schemas.json.JsonSchema object>, 'has_markdown': <vcorelib.schemas.json.JsonSchema object>}#

runtimepy.util module#

A module implementing package utilities.

class runtimepy.util.Identifier(start: int = 1, scale: int = 2)[source]#

Bases: object

A simple message indentifier interface.

runtimepy.util.normalize_root(*src_parts: str | Path) Path[source]#

Make paths absolute that aren’t. Useful for HTTP-request pathing.

runtimepy.util.parse_path_parts(path: str, key: str = 'json') Iterator[str][source]#

Parse a path such that all parts appearing after a possible ‘key’ appears are yielded.

runtimepy.util.path_has_part(path: str, key: str = 'json') bool[source]#

Determine if a key appears as a part of a path.

async runtimepy.util.read_binary(path: Path) bytes[source]#

An async wrapper for reading file contents.

Module contents#

Useful defaults and other package metadata.