ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class ConfigBootstrapper: (source)

Constructor: ConfigBootstrapper(app)

View In Hierarchy

Download and validate missing configuration before creating local files.

Class Method _blob Download raw bytes and verify GitHub's size and Git object hash.
Class Method _createResource Create one validated resource and report whether it existed.
Class Method _entries Validate the master tree and retain regular configuration entries.
Static Method _download Read one successful GitHub response or identify the failed resource.
Static Method _entryOrder Order configuration entries by depth and then by path.
Static Method _safeDestination Reject links and traversal before writing any configuration resource.
Static Method _selectFile Select one configuration module using the validated remote tree.
Static Method _validateLocalResource Reject a local resource whose type conflicts with the official tree.
Method __init__ Retain the application supplying the effective configuration path.
Method bootstrap Restore selected configuration without replacing existing files.
Instance Variable app Application supplying effective configuration paths.
def _blob(cls, entry: dict[str, Any]) -> bytes: (source)

Download raw bytes and verify GitHub's size and Git object hash.

Parameters
entry:dict[str, typing.Any]Validated blob metadata from the official configuration tree.
Returns
bytesUnmodified file contents matching the advertised size and hash.
def _createResource(cls, destination: Path, kind: str, pending: dict[Path, bytes]) -> bool: (source)

Create one validated resource and report whether it existed.

Parameters
destination:pathlib.PathLocal configuration file or directory to create.
kind:strExpected Git tree entry type, either tree or blob.
pending:dict[pathlib.Path, bytes]Validated contents indexed by missing file destinations.
Returns
boolWhether the resource already existed, including concurrent creation.
def _entries(cls) -> list[dict[str, Any]]: (source)

Validate the master tree and retain regular configuration entries.

Returns
list[dict[str, typing.Any]]Valid configuration entries ordered with parent paths before children.
def _download(url: str) -> bytes: (source)

Read one successful GitHub response or identify the failed resource.

Parameters
url:strHTTPS URL constructed from the official GitHub origins.
Returns
bytesComplete response body from an HTTP 200 response.
def _entryOrder(entry: dict[str, Any]) -> tuple[int, str]: (source)

Order configuration entries by depth and then by path.

Parameters
entry:dict[str, typing.Any]Validated configuration tree entry containing its repository path.
Returns
tuple[int, str]Path depth and repository path used for deterministic creation order.
def _safeDestination(root: Path, destination: Path): (source)

Reject links and traversal before writing any configuration resource.

Parameters
root:pathlib.PathEffective configuration root containing all permitted destinations.
destination:pathlib.PathLocal resource path to validate before writing.
Returns
NoneAccept a destination contained within the root and free of links.
def _selectFile(entries: list[dict[str, Any]], file: str) -> list[dict[str, Any]]: (source)

Select one configuration module using the validated remote tree.

Parameters
entries:list[dict[str, typing.Any]]Validated configuration entries from the official master branch.
file:strRequested configuration module name without its Python extension.
Returns
list[dict[str, typing.Any]]The single matching remote configuration file.
Raises
ValueErrorIf the name is absent, with the available remote names in the message.
def _validateLocalResource(destination: Path, kind: str): (source)

Reject a local resource whose type conflicts with the official tree.

Parameters
destination:pathlib.PathLocal configuration resource to inspect.
kind:strExpected Git tree entry type, either tree or blob.
Returns
NoneAccept an absent resource or an existing resource of the expected type.
def __init__(self, app: IApplication): (source)

Retain the application supplying the effective configuration path.

Parameters
app:orionis.IApplicationApplication supplying effective configuration paths.
Returns
NoneStore the application for subsequent recovery operations.
def bootstrap(self, file: str | None = None) -> list[tuple[str, str]]: (source)

Restore selected configuration without replacing existing files.

Parameters
file:str | None, optionalRemote configuration name without the Python extension, or None to restore the complete configuration subtree.
Returns
list[tuple[str, str]]Created or existing resources, relative to the application root.
Raises
RuntimeErrorIf GitHub cannot supply a complete, valid master configuration tree.
ValueErrorIf the selected file is absent from the remote configuration options.
OSErrorIf a local path is unsafe or cannot be created.

Application supplying effective configuration paths.