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

Create application files from packaged stubs.

Method createFile Render one stub into its configured application directory.
Method createFiles Create the files produced by this command.
Method getReplacements Read string replacements from the parsed command arguments.
Method getTemplateName Return the selected template name.
Async Method handle Create configured files without blocking the running event loop.
Class Variable arguments Command-line argument declarations accepted by this command.
Class Variable path_key Application path key selecting the destination directory.
Class Variable postfix Suffix appended to the generated resource name.
Class Variable prefix Prefix applied when constructing names or storage keys.
Class Variable replacement_arguments Command arguments forwarded to template placeholder replacement.
Class Variable success_label Resource label displayed after successful generation.
Class Variable template_name Name of the source template rendered by the generator.
def createFile(self, app: IApplication, name: str, *, template_name: str | None = None, extension: str = 'py', replacements: dict[str, str] | None = None) -> str: (source)

Render one stub into its configured application directory.

Parameters
app:orionis.IApplicationApplication that resolves the destination path.
name:strFile name and optional nested directory path.
template_name:str | None, optionalStub override; the command's template is used when omitted.
extension:str, optionalGenerated source extension. Defaults to "py".
replacements:dict[str, str] | None, optionalPlaceholder values; command replacements are used when omitted.
Returns
strGenerated path relative to the application base directory.
Raises
OSErrorIf the generated file cannot be created.
TypeErrorIf the application path or replacement values are invalid.
ValueErrorIf the name or extension is invalid.
def createFiles(self, app: IApplication, name: str) -> tuple[tuple[str, str], ...]: (source)

Create the files produced by this command.

Parameters
app:orionis.IApplicationApplication that resolves the destination path.
name:strFile name and optional nested directory path.
Returns
tuple[tuple[str, str], ...]Success labels and generated application-relative paths.
def getReplacements(self) -> dict[str, str]: (source)

Read string replacements from the parsed command arguments.

Returns
dict[str, str]Template placeholders mapped to their argument values.
Raises
TypeErrorIf an argument mapped to a placeholder is not a string.
def getTemplateName(self) -> str: (source)

Return the selected template name.

Returns
strStub template name without its .stub suffix.
async def handle(self, app: IApplication) -> int | None: (source)

Create configured files without blocking the running event loop.

Parameters
app:orionis.IApplicationApplication that provides destination paths.
Returns
int or NoneReturn 1 after reporting a generation error, or None on success.

Prefix applied when constructing names or storage keys.

replacement_arguments: ClassVar[dict[str, str]] = (source)

Command arguments forwarded to template placeholder replacement.