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 __contains__ Check if the cache contains the specified key.
Method __delitem__ Remove an item from the memory cache by key.
Method __getitem__ Retrieve a cached value by key.
Method __init__ Initialize the ReflectionInstance with the given object instance.
Method __setitem__ Store a value in the cache with the specified key.
Method _classifyClassEntry Categorize a class method by visibility and append to the accumulator.
Method _classifyFunctionEntry Categorize an instance method by visibility and append to the accumulator.
Method _classifyStaticEntry Categorize a static method by visibility and append to the accumulator.
Method _scanClassMembers Discover and categorize all class members in a single traversal.
Method _scanInstanceVars Categorize instance variables into visibility groups in a single traversal.
Method _scanPropertyEntries Scan the class dict for property descriptors and sort by visibility.
Method clearCache Clear the internal memory cache.
Method constructorSignature Analyze and return constructor dependencies of the instance's class.
Method getAnnotations Retrieve type annotations of the class.
Method getAttribute Retrieve the value of an attribute by name from the instance.
Method getAttributeDocstring Retrieve the docstring of a specific attribute.
Method getAttributes Aggregate all attributes of the instance.
Method getBaseClasses Return the base classes of the instance's class.
Method getClass Return the class of the instance.
Method getClassName Return the name of the instance's class.
Method getDocstring Return the docstring of the instance's class.
Method getDunderAttributes Retrieve all dunder (double underscore) attributes of the instance.
Method getDunderMethods Return all dunder (double underscore) method names of the instance.
Method getFile Return the file path where the class is defined.
Method getInstance Return the reflected object instance.
Method getMagicAttributes Return all magic attributes of the instance.
Method getMagicMethods Return all magic method names of the instance.
Method getMethodDocstring Retrieve the docstring of a method.
Method getMethods Retrieve all method names associated with the instance.
Method getMethodSignature Retrieve the signature of a method.
Method getModuleName Return the name of the module where the class is defined.
Method getModuleWithClassName Return the module and class name as a single string.
Method getPrivateAsyncMethods Retrieve all private asynchronous method names of the instance.
Method getPrivateAttributes Retrieve all private attributes of the instance.
Method getPrivateClassAsyncMethods Retrieve all private asynchronous class method names of the instance.
Method getPrivateClassMethods Return all private class method names of the instance.
Method getPrivateClassSyncMethods Retrieve all private synchronous class method names of the instance.
Method getPrivateMethods Return all private method names of the instance.
Method getPrivateProperties Retrieve all private properties of the instance.
Method getPrivateStaticAsyncMethods Retrieve all private asynchronous static method names of the instance.
Method getPrivateStaticMethods Return all private static method names of the instance.
Method getPrivateStaticSyncMethods Retrieve all private synchronous static method names of the instance.
Method getPrivateSyncMethods Retrieve all private synchronous method names of the instance.
Method getProperties Return all property names of the instance.
Method getProperty Retrieve the value of a property from the instance.
Method getPropertyDocstring Retrieve the docstring for a property.
Method getPropertySignature Return the signature of a property getter.
Method getProtectedAsyncMethods Retrieve all protected asynchronous method names of the instance.
Method getProtectedAttributes Return all protected attributes of the instance.
Method getProtectedClassAsyncMethods Retrieve all protected asynchronous class method names of the instance.
Method getProtectedClassMethods Return all protected class method names of the instance.
Method getProtectedClassSyncMethods Return all protected synchronous class method names of the instance.
Method getProtectedMethods Return all protected method names of the instance.
Method getProtectedProperties Retrieve all protected properties of the instance.
Method getProtectedStaticAsyncMethods Retrieve all protected asynchronous static method names.
Method getProtectedStaticMethods Return all protected static method names of the instance.
Method getProtectedStaticSyncMethods Retrieve all protected synchronous static method names.
Method getProtectedSyncMethods Return all protected synchronous method names of the instance.
Method getPublicAsyncMethods Return all public asynchronous method names of the instance.
Method getPublicAttributes Return all public attributes of the instance.
Method getPublicClassAsyncMethods Return all public asynchronous class method names of the instance.
Method getPublicClassMethods Return all public class method names of the instance.
Method getPublicClassSyncMethods Return all public synchronous class method names of the instance.
Method getPublicMethods Return all public method names of the instance.
Method getPublicProperties Return all public properties of the instance.
Method getPublicStaticAsyncMethods Retrieve all public asynchronous static method names of the instance.
Method getPublicStaticMethods Return the names of all public static methods of the instance's class.
Method getPublicStaticSyncMethods Return all public synchronous static method names of the instance.
Method getPublicSyncMethods Return all public synchronous method names of the instance.
Method getSourceCode Retrieve the source code for the class or a specific method.
Method hasAttribute Check if the instance has a specific attribute.
Method hasMethod Determine if the instance has a specific method.
Method methodSignature Analyze and return dependencies for a method of the instance's class.
Method removeAttribute Remove an attribute from the instance.
Method removeMethod Remove a method from the instance.
Method setAttribute Set the value of an attribute on the instance.
Method setMethod Set a callable attribute as a method.
Instance Variable _class_name Undocumented
Instance Variable _cls Undocumented
Instance Variable _instance Undocumented
Instance Variable _memory_cache Undocumented
Instance Variable _module_name Undocumented
Instance Variable _private_prefix Undocumented
def __contains__(self, key: str) -> bool: (source)

Check if the cache contains the specified key.

Parameters
key:strThe key to check for existence in the cache.
Returns
boolTrue if the key exists in the cache, False otherwise.
def __delitem__(self, key: str): (source)

Remove an item from the memory cache by key.

Parameters
key:strThe key to remove from the cache.
Returns
NoneThis method does not return a value.
def __getitem__(self, key: str) -> object | None: (source)

Retrieve a cached value by key.

Parameters
key:strThe key to look up in the cache.
Returns
object or NoneThe cached value if found, otherwise None.
def __init__(self, instance: Any): (source)

Initialize the ReflectionInstance with the given object instance.

Parameters
instance:AnyThe object instance to reflect.
Returns
NoneThis method does not return a value.
Raises
TypeErrorIf the provided instance is not a valid object instance or is of a built-in/abstract base class.
ValueErrorIf the instance is from '__main__'.
def __setitem__(self, key: str, value: object): (source)

Store a value in the cache with the specified key.

Parameters
key:strThe key under which to store the value.
value:objectThe value to store in the cache.
Returns
NoneThis method does not return a value.
def _classifyClassEntry(self, name: str, attr: Any, acc: dict[str, list[str]]): (source)

Categorize a class method by visibility and append to the accumulator.

Parameters
name:strThe member name as returned by dir().
attr:AnyThe classmethod descriptor.
acc:dict[str, list[str]]Shared accumulator dict keyed by category name.
Returns
NoneThis method does not return a value.
def _classifyFunctionEntry(self, name: str, attr: Any, acc: dict[str, list[str]]): (source)

Categorize an instance method by visibility and append to the accumulator.

Parameters
name:strThe member name as returned by dir().
attr:AnyThe function object.
acc:dict[str, list[str]]Shared accumulator dict keyed by category name.
Returns
NoneThis method does not return a value.
def _classifyStaticEntry(self, name: str, attr: Any, acc: dict[str, list[str]]): (source)

Categorize a static method by visibility and append to the accumulator.

Parameters
name:strThe member name as returned by dir().
attr:AnyThe staticmethod descriptor.
acc:dict[str, list[str]]Shared accumulator dict keyed by category name.
Returns
NoneThis method does not return a value.
def _scanClassMembers(self): (source)

Discover and categorize all class members in a single traversal.

Walks the class dict for properties and dir() for methods, building all method and property category lists and populating the cache in one pass.

Returns
NoneThis method does not return a value.
def _scanInstanceVars(self): (source)

Categorize instance variables into visibility groups in a single traversal.

Populates the cache with public, protected, private, dunder, and combined attribute dictionaries derived from the reflected instance.

Returns
NoneThis method does not return a value.
def _scanPropertyEntries(self, cls: type) -> tuple[list[str], list[str], list[str], list[str]]: (source)

Scan the class dict for property descriptors and sort by visibility.

Parameters
cls:typeThe class whose __dict__ is traversed.
Returns
tuple[list[str], list[str], list[str], list[str]]Four lists: all properties, public, protected, and private.
def clearCache(self): (source)

Clear the internal memory cache.

Removes all cached entries stored in the reflection instance. Subsequent method calls will recompute and cache results.

Returns
NoneThis method does not return a value.
def constructorSignature(self) -> Signature: (source)

Analyze and return constructor dependencies of the instance's class.

Returns
Signature

Structured representation of the constructor dependencies. Contains:

  • resolved: dictionary of resolved dependencies with names and values.
  • unresolved: list of unresolved dependencies (parameter names without default values or annotations).
def getAnnotations(self) -> dict[str, type]: (source)

Retrieve type annotations of the class.

Returns
dict[str, type]Dictionary mapping attribute names to their type annotations.
def getAttribute(self, name: str, default: Any = None) -> Any: (source)

Retrieve the value of an attribute by name from the instance.

Notes

This method first checks the instance's attributes dictionary for the given name. If not found, it attempts to retrieve the attribute directly from the instance using getattr. If the attribute is still not found, the default value is returned.

Parameters
name:strName of the attribute to retrieve.
default:Any, optionalValue to return if the attribute does not exist. Defaults to None.
Returns
AnyValue of the specified attribute if it exists, otherwise the provided default value.
Raises
AttributeErrorIf the attribute does not exist and no default value is provided.
def getAttributeDocstring(self, name: str) -> str | None: (source)

Retrieve the docstring of a specific attribute.

Parameters
name:strName of the attribute.
Returns
str or NoneThe docstring of the attribute, or None if not available.
Raises
AttributeErrorIf the attribute does not exist on the instance.
def getAttributes(self) -> dict[str, Any]: (source)

Aggregate all attributes of the instance.

Combines public, protected, private, and dunder attributes into a single dictionary. Private attribute names are unmangled. The result is cached for performance.

Returns
dict[str, Any]Dictionary mapping attribute names to their values for all visibility levels.
def getBaseClasses(self) -> tuple[type, ...]: (source)

Return the base classes of the instance's class.

Returns
tuple of typeTuple containing the base classes of the class.
def getClass(self) -> type: (source)

Return the class of the instance.

Returns
typeThe class object of the instance.
def getClassName(self) -> str: (source)

Return the name of the instance's class.

Returns
strThe name of the class.
def getDocstring(self) -> str | None: (source)

Return the docstring of the instance's class.

Returns
str or NoneThe docstring of the class, or None if not available.
def getDunderAttributes(self) -> dict[str, Any]: (source)

Retrieve all dunder (double underscore) attributes of the instance.

Parameters
self:ReflectionInstance
Returns
dict[str, Any]Dictionary mapping dunder attribute names to their values.
def getDunderMethods(self) -> list[str]: (source)

Return all dunder (double underscore) method names of the instance.

Returns
list of strList of dunder method names defined on the instance.
def getFile(self) -> str | None: (source)

Return the file path where the class is defined.

Returns
str or NoneThe file path of the class definition, or None if unavailable.
def getInstance(self) -> Any: (source)

Return the reflected object instance.

Returns
AnyThe object instance being reflected upon.
def getMagicAttributes(self) -> dict[str, Any]: (source)

Return all magic attributes of the instance.

Returns
dict[str, Any]Dictionary mapping magic attribute names to their values.
def getMagicMethods(self) -> list[str]: (source)

Return all magic method names of the instance.

Returns
list of strList of magic (dunder) method names defined on the instance.
def getMethodDocstring(self, name: str) -> str | None: (source)

Retrieve the docstring of a method.

Parameters
name:strName of the method.
Returns
str | NoneThe docstring of the method, or None if not available.
Raises
AttributeErrorIf the method does not exist on the class.
def getMethods(self) -> list[str]: (source)

Retrieve all method names associated with the instance.

Aggregates method names from public, protected, private, class, and static categories by calling their respective getter methods. The result is cached for performance.

Returns
list of strList of all method names (instance, class, static) defined on the instance's class, including public, protected, and private methods.
def getMethodSignature(self, name: str) -> inspect.Signature: (source)

Retrieve the signature of a method.

Parameters
name:strName of the method.
Returns
inspect.SignatureSignature object representing the method's parameters and return type.
Raises
AttributeErrorIf the method does not exist or is not callable.
def getModuleName(self) -> str: (source)

Return the name of the module where the class is defined.

Returns
strThe module name where the class is defined.
def getModuleWithClassName(self) -> str: (source)

Return the module and class name as a single string.

Returns
strThe module name and class name in the format 'module.ClassName'.
def getPrivateAsyncMethods(self) -> list[str]: (source)

Retrieve all private asynchronous method names of the instance.

Returns
list of strList of private asynchronous method names (unmangled).
def getPrivateAttributes(self) -> dict[str, Any]: (source)

Retrieve all private attributes of the instance.

Parameters
self:ReflectionInstance
Returns
dict[str, Any]Dictionary mapping unmangled private attribute names to their values.
def getPrivateClassAsyncMethods(self) -> list[str]: (source)

Retrieve all private asynchronous class method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of private asynchronous class method names.
def getPrivateClassMethods(self) -> list[str]: (source)

Return all private class method names of the instance.

Returns
list of strList of private class method names (unmangled).
def getPrivateClassSyncMethods(self) -> list[str]: (source)

Retrieve all private synchronous class method names of the instance.

Returns
list of strList of private synchronous class method names.
def getPrivateMethods(self) -> list[str]: (source)

Return all private method names of the instance.

Private methods are those whose names start with the class name prefix (name-mangled), but do not start with double underscores.

Returns
list of strList of private method names, unmangled (without class name prefix).
def getPrivateProperties(self) -> list: (source)

Retrieve all private properties of the instance.

Returns
listList of private property names (unmangled).
def getPrivateStaticAsyncMethods(self) -> list[str]: (source)

Retrieve all private asynchronous static method names of the instance.

Returns
list of strList of private asynchronous static method names defined on the class.
def getPrivateStaticMethods(self) -> list[str]: (source)

Return all private static method names of the instance.

Returns
list of strList of private static method names defined on the class.
def getPrivateStaticSyncMethods(self) -> list[str]: (source)

Retrieve all private synchronous static method names of the instance.

Returns
list of strList of private synchronous static method names defined on the class.
def getPrivateSyncMethods(self) -> list[str]: (source)

Retrieve all private synchronous method names of the instance.

Returns
list of strList of private synchronous method names (unmangled).
def getProperties(self) -> list[str]: (source)

Return all property names of the instance.

Returns
list of strList of property names defined as properties on the class.
def getProperty(self, name: str) -> Any: (source)

Retrieve the value of a property from the instance.

Parameters
name:strName of the property to retrieve.
Returns
AnyValue of the specified property.
Raises
AttributeErrorIf the property does not exist or is not accessible.
def getPropertyDocstring(self, name: str) -> str: (source)

Retrieve the docstring for a property.

Parameters
name:strName of the property.
Returns
strThe docstring of the property, or an empty string if not present.
Raises
AttributeErrorIf the property does not exist on the class.
def getPropertySignature(self, name: str) -> inspect.Signature: (source)

Return the signature of a property getter.

Parameters
name:strName of the property.
Returns
inspect.SignatureSignature of the property's getter method.
Raises
AttributeErrorIf the property does not exist on the class.
def getProtectedAsyncMethods(self) -> list[str]: (source)

Retrieve all protected asynchronous method names of the instance.

Notes

Protected asynchronous methods start with a single underscore, are not private, and are coroutine functions.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of protected asynchronous method names.
def getProtectedAttributes(self) -> dict[str, Any]: (source)

Return all protected attributes of the instance.

Parameters
self:ReflectionInstance
Returns
dict[str, Any]Dictionary containing protected attribute names and their values. Protected attributes start with a single underscore, are not dunder, and are not private (do not start with the class name).
def getProtectedClassAsyncMethods(self) -> list[str]: (source)

Retrieve all protected asynchronous class method names of the instance.

Returns
list of strList of protected asynchronous class method names.
def getProtectedClassMethods(self) -> list[str]: (source)

Return all protected class method names of the instance.

Returns
list of strList of protected class method names.
def getProtectedClassSyncMethods(self) -> list[str]: (source)

Return all protected synchronous class method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of protected synchronous class method names.
def getProtectedMethods(self) -> list[str]: (source)

Return all protected method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of protected method names. Protected methods start with a single underscore, are not private (do not start with the class name), and are not dunder methods.
def getProtectedProperties(self) -> list: (source)

Retrieve all protected properties of the instance.

Returns
listList of protected property names (unmangled).
def getProtectedStaticAsyncMethods(self) -> list[str]: (source)

Retrieve all protected asynchronous static method names.

Parameters
None
Returns
list of strList of protected asynchronous static method names defined on the class.
def getProtectedStaticMethods(self) -> list[str]: (source)

Return all protected static method names of the instance.

Returns
list of strList of protected static method names defined on the class.
def getProtectedStaticSyncMethods(self) -> list[str]: (source)

Retrieve all protected synchronous static method names.

Returns
list of strList of protected synchronous static method names defined on the class.
def getProtectedSyncMethods(self) -> list[str]: (source)

Return all protected synchronous method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of protected synchronous method names.
def getPublicAsyncMethods(self) -> list[str]: (source)

Return all public asynchronous method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of public asynchronous method names.
def getPublicAttributes(self) -> dict[str, Any]: (source)

Return all public attributes of the instance.

Parameters
self:ReflectionInstance
Returns
dict[str, Any]Dictionary mapping public attribute names to their values. Excludes dunder, protected, and private attributes.
def getPublicClassAsyncMethods(self) -> list[str]: (source)

Return all public asynchronous class method names of the instance.

Returns
list of strList of public asynchronous class method names.
def getPublicClassMethods(self) -> list[str]: (source)

Return all public class method names of the instance.

Returns
list of strList of public class method names.
def getPublicClassSyncMethods(self) -> list[str]: (source)

Return all public synchronous class method names of the instance.

Returns
list of strList of public synchronous class method names.
def getPublicMethods(self) -> list[str]: (source)

Return all public method names of the instance.

Parameters
self:ReflectionInstanceThe ReflectionInstance object.
Returns
list of strList of public method names. Public methods are not static, class, private, protected, or magic methods.
def getPublicProperties(self) -> list: (source)

Return all public properties of the instance.

Returns
listList of public property names.
def getPublicStaticAsyncMethods(self) -> list[str]: (source)

Retrieve all public asynchronous static method names of the instance.

Returns
list of strList of public asynchronous static method names defined on the class.
def getPublicStaticMethods(self) -> list[str]: (source)

Return the names of all public static methods of the instance's class.

Returns
list of strList of public static method names defined on the class.
def getPublicStaticSyncMethods(self) -> list[str]: (source)

Return all public synchronous static method names of the instance.

Returns
list of strList of public synchronous static method names defined on the class.
def getPublicSyncMethods(self) -> list[str]: (source)

Return all public synchronous method names of the instance.

Returns
list of strList of public synchronous method names.
def getSourceCode(self, method: str | None = None) -> str | None: (source)

Retrieve the source code for the class or a specific method.

Notes

Handles name mangling for private methods. Returns None if the source code cannot be retrieved (e.g., for built-in or dynamically generated objects).

Parameters
method:str or None, optionalName of the method to retrieve source code for. If None, retrieves the source code of the class.
Returns
str or NoneThe source code as a string if available, otherwise None.
def hasAttribute(self, name: str) -> bool: (source)

Check if the instance has a specific attribute.

Parameters
name:strAttribute name to check.
Returns
boolTrue if the attribute exists, False otherwise.
def hasMethod(self, name: str) -> bool: (source)

Determine if the instance has a specific method.

Notes

Checks the presence of the method in the aggregated method list.

Parameters
name:strName of the method to check.
Returns
boolTrue if the method exists, otherwise False.
def methodSignature(self, method_name: str) -> Signature: (source)

Analyze and return dependencies for a method of the instance's class.

Parameters
method_name:strName of the method to inspect.
Returns
Signature

Structured representation of the method dependencies, including:

  • resolved: dictionary of resolved dependencies with names and values.
  • unresolved: list of unresolved dependencies (parameter names without default values or annotations).
Raises
AttributeErrorIf the method does not exist on the class.
def removeAttribute(self, name: str) -> bool: (source)

Remove an attribute from the instance.

Notes

Clears the memory cache after removal.

Parameters
name:strName of the attribute to remove.
Returns
boolTrue if the attribute was removed successfully.
Raises
AttributeErrorIf the attribute does not exist or is read-only.
def removeMethod(self, name: str): (source)

Remove a method from the instance.

Parameters
name:strName of the method to remove.
Returns
NoneThis method does not return a value.
Raises
AttributeErrorIf the method does not exist or is not callable.
def setAttribute(self, name: str, value: Any) -> bool: (source)

Set the value of an attribute on the instance.

Parameters
name:strName of the attribute to set.
value:AnyValue to assign to the attribute.
Returns
boolTrue if the attribute was set successfully.
Raises
AttributeErrorIf the attribute name is invalid, is a keyword, or the value is callable.
def setMethod(self, name: str, method: Callable) -> bool: (source)

Set a callable attribute as a method.

Parameters
name:strName of the method to set.
method:CallableCallable object to assign as the method.
Returns
boolTrue if the method was set successfully.
Raises
AttributeErrorIf the name is not a valid identifier, is a keyword, or the method is not callable.
_class_name: str = (source)

Undocumented

Undocumented

_instance: Any = (source)

Undocumented

_memory_cache: dict[str, Any] = (source)

Undocumented

_module_name: str = (source)

Undocumented

_private_prefix: str = (source)

Undocumented