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

Undocumented

Method __compileFilenameAndClassname Compile the generated filename and class name.
Method __init__ Initialize a stub generator.
Method __loadTemplate Load the requested stub template.
Method __parseName Normalize a generated name and reject unsafe path components.
Method __replaceTemplateContent Replace placeholders in the loaded template.
Method create Create the generated source file.
Class Variable __slots__ Undocumented
Instance Variable _class_name Undocumented
Instance Variable _classname Undocumented
Instance Variable _directory_parts Undocumented
Instance Variable _filename Undocumented
Instance Variable _postfix Undocumented
Instance Variable _prefix Undocumented
Instance Variable _replacements Undocumented
Instance Variable _template_name Undocumented
def __compileFilenameAndClassname(self): (source)

Compile the generated filename and class name.

Returns
NoneThe derived filename and class name are stored on the instance.
Raises
ValueErrorIf the generated filename does not match the accepted format.
def __init__(self, template_name: str, class_name: str, prefix: str | None = None, postfix: str | None = None, replacements: dict[str, str] | None = None): (source)

Initialize a stub generator.

Parameters
template_name:strName of the template file without its .stub suffix.
class_name:strName used to derive the generated filename and class name.
prefix:str | None, optionalPrefix prepended to the derived filename and class name.
postfix:str | None, optionalSuffix appended to the derived filename and class name.
replacements:dict[str, str] | None, optionalPlaceholder values to apply to the loaded template.
Returns
NoneThe instance is initialized in place.
def __loadTemplate(self) -> str: (source)

Load the requested stub template.

Returns
strThe unmodified template content.
Raises
FileNotFoundErrorIf the requested stub file does not exist.
ValueErrorIf the template name does not identify a packaged stub.
def __parseName(self) -> tuple[str, ...]: (source)

Normalize a generated name and reject unsafe path components.

Returns
tuple[str, ...]Directory components followed by the file stem.
Raises
ValueErrorIf the name is empty, absolute, traverses a parent directory, or contains a component that cannot form a Python module name.
def __replaceTemplateContent(self, content: str) -> str: (source)

Replace placeholders in the loaded template.

Parameters
content:strTemplate content to update.
Returns
strTemplate content with the class name and replacements applied.
Raises
TypeErrorIf a replacement key or value is not a string.
def create(self, directory: Path, relative_to: Path | None = None, extension: str = 'py') -> str: (source)

Create the generated source file.

Parameters
directory:PathDirectory where the generated Python file is created.
relative_to:Path | None, optionalPath to which the generated file path should be made relative. Both paths are resolved before computing the relative path. If None, the file path is returned as an absolute path.
extension:str, optionalFile extension for the generated Python file. Defaults to "py".
Returns
strPath to the generated file as a string.
Raises
FileNotFoundErrorIf the requested stub template does not exist.
TypeErrorIf a replacement key or value is not a string.
ValueErrorIf the generated filename, template name, or extension is invalid, or the resolved file is outside relative_to.
__slots__: tuple[str, ...] = (source)

Undocumented

_class_name: str = (source)

Undocumented

_classname: str | None = (source)

Undocumented

_directory_parts: tuple[str, ...] = (source)

Undocumented

_filename: str | None = (source)

Undocumented

_postfix: str | None = (source)

Undocumented

_prefix: str | None = (source)

Undocumented

_replacements: dict[str, str] | None = (source)

Undocumented

_template_name: str = (source)

Undocumented