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 __init__ Validate the factory and initialize its independent data provider.
Method _ensureIdle Reject reconfiguration or overlapping use of an active factory.
Method _makeOne Merge one definition and construct a model through mass assignment.
Method clearUnique Clear remembered unique values without reseeding or rewinding.
Method count Set the number of models generated by subsequent operations.
Async Method create Construct and save each model through Orionis's event lifecycle.
Method definition Define the default attributes of one model.
Async Method iterCreate Yield models immediately after each awaited save operation.
Method iterMake Yield unsaved models progressively, holding no result collection.
Method make Construct models without database access or persistence events.
Method sequence Install a sequence and restart this factory's position at zero.
Method state Append attributes or a synchronous transformation of defaults.
Class Variable __slots__ Undocumented
Class Variable model Undocumented
Instance Variable _busy Undocumented
Instance Variable _count Undocumented
Instance Variable _fake Undocumented
Instance Variable _model Undocumented
Instance Variable _sequence Undocumented
Instance Variable _sequence_index Undocumented
Instance Variable _states Undocumented
Property fake Expose the instance's typed camelCase data provider facade.
def __init__(self, *, locale: str | None = None, seed: int | None = None): (source)

Validate the factory and initialize its independent data provider.

Parameters
locale:str or None, optionalExplicit locale override, or the configured app.locale. Unavailable or unsupported locales fall back to en_US.
seed:int or None, optionalSeed for the instance's random generator.
Returns
NoneApply the described operation.
Raises
FactoryConfigurationExceptionIf the model, locale or seed is invalid.
FactoryDefinitionExceptionIf no synchronous definition method is implemented.
def _ensureIdle(self): (source)

Reject reconfiguration or overlapping use of an active factory.

Returns
NoneApply the described operation.
Raises
FactoryConcurrencyExceptionIf another operation owns this instance.
def _makeOne(self, overrides: dict[str, Any]) -> TModel: (source)

Merge one definition and construct a model through mass assignment.

Parameters
overrides:dict of str to AnyDetached explicit attributes for the current operation.
Returns
TModelNew model with normal casts and mutators applied.
def clearUnique(self) -> Self: (source)

Clear remembered unique values without reseeding or rewinding.

Returns
SelfThis factory, with its instance-wide unique pool cleared.
def count(self, count: int) -> Self: (source)

Set the number of models generated by subsequent operations.

Parameters
count:intNonnegative count; one returns a model, all others a Collection.
Returns
SelfThis configured factory.
Raises
FactoryConfigurationExceptionIf count is not a nonnegative integer.
async def create(self, **overrides: Any) -> TModel | Collection: (source)

Construct and save each model through Orionis's event lifecycle.

Notes

No implicit transaction is opened. Earlier successful writes survive a later failure unless the caller supplies a database transaction.

Parameters
**overrides:AnyFinal attribute overrides, subject to normal mass assignment.
Returns
TModel or CollectionPersisted models, with the same cardinality rules as make.
def definition(self) -> dict[str, Any]: (source)

Define the default attributes of one model.

Returns
dict of str to AnyAttributes to assign through the model constructor.
Raises
FactoryDefinitionExceptionAlways, unless overridden by a concrete factory.
async def iterCreate(self, **overrides: Any) -> AsyncIterator[TModel]: (source)

Yield models immediately after each awaited save operation.

Notes

Use contextlib.aclosing when stopping iteration early.

Parameters
**overrides:AnyFinal attributes, copied before the first persistence await.
Returns
AsyncIterator[TModel]Undocumented
Yields
TModelOne successfully persisted model per iteration.
Raises
FactoryPersistenceExceptionIf a model event vetoes saving.
def iterMake(self, **overrides: Any) -> Iterator[TModel]: (source)

Yield unsaved models progressively, holding no result collection.

Notes

Close a partially consumed iterator before reusing this factory.

Parameters
**overrides:AnyFinal attribute overrides copied when iteration starts.
Returns
Iterator[TModel]Undocumented
Yields
TModelOne unsaved model per iteration.
def make(self, **overrides: Any) -> TModel | Collection: (source)

Construct models without database access or persistence events.

Parameters
**overrides:AnyAttributes taking precedence over defaults, states and sequence.
Returns
TModel or CollectionOne model for count one; otherwise a Collection of models.
def sequence(self, sequence: Sequence) -> Self: (source)

Install a sequence and restart this factory's position at zero.

Parameters
sequence:SequenceCycling mappings or callbacks of the absolute item index.
Returns
SelfThis configured factory.
Raises
FactoryConfigurationExceptionIf sequence is not a Sequence instance.
def state(self, state: State) -> Self: (source)

Append attributes or a synchronous transformation of defaults.

Parameters
state:dict or CallableDictionary or callback receiving detached current attributes.
Returns
SelfThis configured factory.
Raises
FactoryConfigurationExceptionIf state is not a dictionary or synchronous callable.
__slots__: tuple[str, ...] = (source)

Undocumented

model: type[TModel] | None = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

_sequence_index: int = (source)

Undocumented

_states: list[State] = (source)

Undocumented

Expose the instance's typed camelCase data provider facade.

Returns
FakeOrionis facade, including custom providers and unique.