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.
Undocumented
| Method | __init__ |
Validate the factory and initialize its independent data provider. |
| Method | _ensure |
Reject reconfiguration or overlapping use of an active factory. |
| Method | _make |
Merge one definition and construct a model through mass assignment. |
| Method | clear |
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 | iter |
Yield models immediately after each awaited save operation. |
| Method | iter |
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 |
Undocumented |
| Instance Variable | _states |
Undocumented |
| Property | fake |
Expose the instance's typed camelCase data provider facade. |
Validate the factory and initialize its independent data provider.
| Parameters | |
locale:str or None, optional | Explicit locale override, or the configured app.locale. Unavailable or unsupported locales fall back to en_US. |
seed:int or None, optional | Seed for the instance's random generator. |
| Returns | |
None | Apply the described operation. |
| Raises | |
FactoryConfigurationException | If the model, locale or seed is invalid. |
FactoryDefinitionException | If no synchronous definition method is implemented. |
Reject reconfiguration or overlapping use of an active factory.
| Returns | |
None | Apply the described operation. |
| Raises | |
FactoryConcurrencyException | If another operation owns this instance. |
Clear remembered unique values without reseeding or rewinding.
| Returns | |
Self | This factory, with its instance-wide unique pool cleared. |
Set the number of models generated by subsequent operations.
| Parameters | |
count:int | Nonnegative count; one returns a model, all others a Collection. |
| Returns | |
Self | This configured factory. |
| Raises | |
FactoryConfigurationException | If count is not a nonnegative integer. |
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:Any | Final attribute overrides, subject to normal mass assignment. |
| Returns | |
TModel or Collection | Persisted models, with the same cardinality rules as make. |
Define the default attributes of one model.
| Returns | |
dict of str to Any | Attributes to assign through the model constructor. |
| Raises | |
FactoryDefinitionException | Always, unless overridden by a concrete factory. |
Yield models immediately after each awaited save operation.
Notes
Use contextlib.aclosing when stopping iteration early.
| Parameters | |
**overrides:Any | Final attributes, copied before the first persistence await. |
| Returns | |
AsyncIterator[ | Undocumented |
| Yields | |
TModel | One successfully persisted model per iteration. |
| Raises | |
FactoryPersistenceException | If a model event vetoes saving. |
Yield unsaved models progressively, holding no result collection.
Notes
Close a partially consumed iterator before reusing this factory.
| Parameters | |
**overrides:Any | Final attribute overrides copied when iteration starts. |
| Returns | |
Iterator[ | Undocumented |
| Yields | |
TModel | One unsaved model per iteration. |
Construct models without database access or persistence events.
| Parameters | |
**overrides:Any | Attributes taking precedence over defaults, states and sequence. |
| Returns | |
TModel or Collection | One model for count one; otherwise a Collection of models. |
Install a sequence and restart this factory's position at zero.
| Parameters | |
sequence:Sequence | Cycling mappings or callbacks of the absolute item index. |
| Returns | |
Self | This configured factory. |
| Raises | |
FactoryConfigurationException | If sequence is not a Sequence instance. |
Append attributes or a synchronous transformation of defaults.
| Parameters | |
state:dict or Callable | Dictionary or callback receiving detached current attributes. |
| Returns | |
Self | This configured factory. |
| Raises | |
FactoryConfigurationException | If state is not a dictionary or synchronous callable. |