Examples¶
This library contains a few example applications of event sourcing in Python.
Example aggregates¶
The aggregate examples show a range of different styles for coding aggregate
classes, from the declarative syntax which provides the most concise style
for expressing business concerns, to a functional style which uses immutable
aggregate objects. All these examples make use of the library’s application
and persistence modules. All these examples satisfy the same test case which
involves creating and updating a Dog
aggregate, and taking a snapshot.
- Aggregate 1 - Declarative syntax
- Aggregate 2 - Explicit event classes
- Aggregate 3 - Explicit trigger and apply
- Aggregate 4 - Custom base classes
- Aggregate 5 - Immutable aggregate
- Aggregate 6 - Functional style
- Aggregate 7 - Pydantic and orjson
- Aggregate 8 - Pydantic with declarative syntax
- Aggregate 9 - msgspec structs
- Aggregate 10 - msgspec with declarative syntax
- Aggregate 11 - String IDs