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 IReflectionInstance(ABC): (source)
Known subclasses: orionis.introspection.ReflectionInstance
Undocumented
| Method | clear |
Clear the internal memory cache. |
| Method | constructor |
Analyze and return constructor dependencies of the instance's class. |
| Method | get |
Retrieve type annotations of the class. |
| Method | get |
Retrieve the value of an attribute by name from the instance. |
| Method | get |
Aggregate all attributes of the instance. |
| Method | get |
Return the base classes of the instance's class. |
| Method | get |
Return the class of the instance. |
| Method | get |
Return the name of the instance's class. |
| Method | get |
Return the docstring of the instance's class. |
| Method | get |
Retrieve all dunder (double underscore) attributes of the instance. |
| Method | get |
Return all dunder (double underscore) method names of the instance. |
| Method | get |
Return the file path where the class is defined. |
| Method | get |
Return the reflected object instance. |
| Method | get |
Return all magic attributes of the instance. |
| Method | get |
Return all magic method names of the instance. |
| Method | get |
Retrieve the docstring of a method. |
| Method | get |
Retrieve all method names associated with the instance. |
| Method | get |
Retrieve the signature of a method. |
| Method | get |
Return the name of the module where the class is defined. |
| Method | get |
Return the module and class name as a single string. |
| Method | get |
Retrieve all private asynchronous method names of the instance. |
| Method | get |
Retrieve all private attributes of the instance. |
| Method | get |
Retrieve all private asynchronous class method names of the instance. |
| Method | get |
Return all private class method names of the instance. |
| Method | get |
Retrieve all private synchronous class method names of the instance. |
| Method | get |
Return all private method names of the instance. |
| Method | get |
Retrieve all private properties of the instance. |
| Method | get |
Retrieve all private asynchronous static method names of the instance. |
| Method | get |
Return all private static method names of the instance. |
| Method | get |
Retrieve all private synchronous static method names of the instance. |
| Method | get |
Retrieve all private synchronous method names of the instance. |
| Method | get |
Return all property names of the instance. |
| Method | get |
Retrieve the value of a property from the instance. |
| Method | get |
Retrieve the docstring for a property. |
| Method | get |
Return the signature of a property getter. |
| Method | get |
Retrieve all protected asynchronous method names of the instance. |
| Method | get |
Return all protected attributes of the instance. |
| Method | get |
Retrieve all protected asynchronous class method names of the instance. |
| Method | get |
Return all protected class method names of the instance. |
| Method | get |
Return all protected synchronous class method names of the instance. |
| Method | get |
Return all protected method names of the instance. |
| Method | get |
Retrieve all protected properties of the instance. |
| Method | get |
Retrieve all protected asynchronous static method names. |
| Method | get |
Return all protected static method names of the instance. |
| Method | get |
Retrieve all protected synchronous static method names. |
| Method | get |
Return all protected synchronous method names of the instance. |
| Method | get |
Return all public asynchronous method names of the instance. |
| Method | get |
Return all public attributes of the instance. |
| Method | get |
Return all public asynchronous class method names of the instance. |
| Method | get |
Return all public class method names of the instance. |
| Method | get |
Return all public synchronous class method names of the instance. |
| Method | get |
Return all public method names of the instance. |
| Method | get |
Return all public properties of the instance. |
| Method | get |
Retrieve all public asynchronous static method names of the instance. |
| Method | get |
Return the names of all public static methods of the instance's class. |
| Method | get |
Return all public synchronous static method names of the instance. |
| Method | get |
Return all public synchronous method names of the instance. |
| Method | get |
Retrieve the source code for the class or a specific method. |
| Method | has |
Check if the instance has a specific attribute. |
| Method | has |
Determine if the instance has a specific method. |
| Method | method |
Analyze and return dependencies for a method of the instance's class. |
| Method | remove |
Remove an attribute from the instance. |
| Method | remove |
Remove a method from the instance. |
| Method | set |
Set the value of an attribute on the instance. |
| Method | set |
Set a callable attribute as a method. |
orionis.introspection.ReflectionInstanceClear the internal memory cache.
Removes all cached entries stored in the reflection instance. Subsequent method calls will recompute and cache results.
| Returns | |
None | This method does not return a value. |
orionis.introspection.ReflectionInstanceAnalyze and return constructor dependencies of the instance's class.
| Returns | |
Signature | Structured representation of the constructor dependencies. Contains:
|
orionis.introspection.ReflectionInstanceRetrieve 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:str | Name of the attribute to retrieve. |
default:Any, optional | Value to return if the attribute does not exist. Defaults to None. |
| Returns | |
Any | Value of the specified attribute if it exists, otherwise the provided
default value. |
| Raises | |
AttributeError | If the attribute does not exist and no default value is provided. |
orionis.introspection.ReflectionInstanceAggregate 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. |
orionis.introspection.ReflectionInstanceReturn the class of the instance.
| Returns | |
type | The class object of the instance. |
orionis.introspection.ReflectionInstanceReturn the name of the instance's class.
| Returns | |
str | The name of the class. |
orionis.introspection.ReflectionInstanceRetrieve all dunder (double underscore) attributes of the instance.
| Parameters | |
self:ReflectionInstance | |
| Returns | |
dict[str, Any] | Dictionary mapping dunder attribute names to their values. |
orionis.introspection.ReflectionInstanceReturn the reflected object instance.
| Returns | |
Any | The object instance being reflected upon. |
orionis.introspection.ReflectionInstanceRetrieve the docstring of a method.
| Parameters | |
name:str | Name of the method. |
| Returns | |
str | None | The docstring of the method, or None if not available. |
| Raises | |
AttributeError | If the method does not exist on the class. |
orionis.introspection.ReflectionInstanceRetrieve 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 str | List of all method names (instance, class, static) defined on the instance's class, including public, protected, and private methods. |
orionis.introspection.ReflectionInstanceRetrieve the signature of a method.
| Parameters | |
name:str | Name of the method. |
| Returns | |
inspect.Signature | Signature object representing the method's parameters and return type. |
| Raises | |
AttributeError | If the method does not exist or is not callable. |
orionis.introspection.ReflectionInstanceReturn the name of the module where the class is defined.
| Returns | |
str | The module name where the class is defined. |
orionis.introspection.ReflectionInstanceReturn the module and class name as a single string.
| Returns | |
str | The module name and class name in the format 'module.ClassName'. |
orionis.introspection.ReflectionInstanceRetrieve all private attributes of the instance.
| Parameters | |
self:ReflectionInstance | |
| Returns | |
dict[str, Any] | Dictionary mapping unmangled private attribute names to their values. |
orionis.introspection.ReflectionInstanceRetrieve all private asynchronous class method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of private asynchronous class method names. |
orionis.introspection.ReflectionInstanceRetrieve all private properties of the instance.
| Returns | |
list | List of private property names (unmangled). |
orionis.introspection.ReflectionInstanceRetrieve the value of a property from the instance.
| Parameters | |
name:str | Name of the property to retrieve. |
| Returns | |
Any | Value of the specified property. |
| Raises | |
AttributeError | If the property does not exist or is not accessible. |
orionis.introspection.ReflectionInstanceRetrieve the docstring for a property.
| Parameters | |
name:str | Name of the property. |
| Returns | |
str | The docstring of the property, or an empty string if not present. |
| Raises | |
AttributeError | If the property does not exist on the class. |
orionis.introspection.ReflectionInstanceReturn the signature of a property getter.
| Parameters | |
name:str | Name of the property. |
| Returns | |
inspect.Signature | Signature of the property's getter method. |
| Raises | |
AttributeError | If the property does not exist on the class. |
orionis.introspection.ReflectionInstanceRetrieve 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:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of protected asynchronous method names. |
orionis.introspection.ReflectionInstanceReturn 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). |
orionis.introspection.ReflectionInstanceReturn all protected synchronous class method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of protected synchronous class method names. |
orionis.introspection.ReflectionInstanceReturn all protected method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List 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. |
orionis.introspection.ReflectionInstanceRetrieve all protected properties of the instance.
| Returns | |
list | List of protected property names (unmangled). |
orionis.introspection.ReflectionInstanceReturn all protected synchronous method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of protected synchronous method names. |
orionis.introspection.ReflectionInstanceReturn all public asynchronous method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of public asynchronous method names. |
orionis.introspection.ReflectionInstanceReturn 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. |
orionis.introspection.ReflectionInstanceReturn all public method names of the instance.
| Parameters | |
self:ReflectionInstance | The ReflectionInstance object. |
| Returns | |
list of str | List of public method names. Public methods are not static, class, private, protected, or magic methods. |
orionis.introspection.ReflectionInstanceReturn all public properties of the instance.
| Returns | |
list | List of public property names. |
orionis.introspection.ReflectionInstanceRetrieve 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, optional | Name of the method to retrieve source code for. If None, retrieves the source code of the class. |
| Returns | |
str or None | The source code as a string if available, otherwise None. |
orionis.introspection.ReflectionInstanceAnalyze and return dependencies for a method of the instance's class.
| Parameters | |
methodstr | Name of the method to inspect. |
| Returns | |
Signature | Structured representation of the method dependencies, including:
|
| Raises | |
AttributeError | If the method does not exist on the class. |
orionis.introspection.ReflectionInstanceRemove an attribute from the instance.
Notes
Clears the memory cache after removal.
| Parameters | |
name:str | Name of the attribute to remove. |
| Returns | |
bool | True if the attribute was removed successfully. |
| Raises | |
AttributeError | If the attribute does not exist or is read-only. |
orionis.introspection.ReflectionInstanceRemove a method from the instance.
| Parameters | |
name:str | Name of the method to remove. |
| Returns | |
None | This method does not return a value. |
| Raises | |
AttributeError | If the method does not exist or is not callable. |
orionis.introspection.ReflectionInstanceSet the value of an attribute on the instance.
| Parameters | |
name:str | Name of the attribute to set. |
value:Any | Value to assign to the attribute. |
| Returns | |
bool | True if the attribute was set successfully. |
| Raises | |
AttributeError | If the attribute name is invalid, is a keyword, or the value is callable. |
orionis.introspection.ReflectionInstanceSet a callable attribute as a method.
| Parameters | |
name:str | Name of the method to set. |
method:Callable | Callable object to assign as the method. |
| Returns | |
bool | True if the method was set successfully. |
| Raises | |
AttributeError | If the name is not a valid identifier, is a keyword, or the method is not callable. |