potoroo package
Python implementations of the Repository and UnitOfWork abstractions.
- class BasicRepo[source]
Bases:
Generic[K,V],ABCThe simplest possible Repository type.
- class QueryRepo[source]
Bases:
Repo[K,V],Generic[K,V,Q],ABCA Repository that is aware of some kind of “querys”.
Adds the ability to retrieve / delete a group of objects based off of some arbitrary “query” type.
- NOTE: In general, K can be expected to be a primitive type, whereas Q is
often a custom user-defined type.
- class Repo[source]
Bases:
BasicRepo[K,V],Generic[K,V],ABCA full-featured Repository
Adds the ability to update, delete, and list all items ontop of the BasicRepo type.
- abstract all()[source]
Retrieve all items stored in this repo.
- Return type:
Union[Ok[list[TypeVar(V)],ErisError],Err[list[TypeVar(V)],ErisError]]
- abstract remove(item, /)[source]
Remove an item from the repo.
- Parameters:
item (
TypeVar(V)) –- Return type:
Union[Ok[Optional[TypeVar(V)],ErisError],Err[Optional[TypeVar(V)],ErisError]]