Modules¶
This library contains several modules that can help with event sourcing in Python.
domain
— Domain models- Aggregates in DDD
- Event-sourced aggregates
- Domain events
- Aggregate events
- Aggregate “created” events
- “Subsequent” aggregate events
- “Discarded” events
- Aggregate base class
- Creating new aggregates
- Aggregate object attributes
- Triggering subsequent events
- Collecting pending events
- Simple example
- Namespaced IDs
- Alternative styles for implementing aggregate projector
- Declarative syntax
- Create new aggregate by calling the aggregate class directly
- Using the init method to define the created event class
- Dataclass-style init methods
- Declaring the created event class name
- Defining the aggregate ID
- The event decorator
- Inferring the event class name from the method name
- Using an explicitly defined event class
- The Dog aggregate class revisited
- The Page and Index aggregates revisited
- Non-trivial command methods
- Raising exceptions in the body of decorated methods
- The
@aggregate
decorator
- Timestamp timezones
- Initial version number
- Topic strings
- Versioning
- Snapshots
- Notes
- Classes
DomainEventProtocol
MutableAggregateProtocol
ImmutableAggregateProtocol
MutableOrImmutableAggregate
TMutableOrImmutableAggregate
CollectEventsProtocol
CanMutateProtocol
create_utc_datetime_now()
CanCreateTimestamp
HasOriginatorIDVersion
CanMutateAggregate
CanInitAggregate
MetaDomainEvent
DomainEvent
AggregateEvent
AggregateCreated
EventSourcingError
ProgrammingError
LogEvent
event()
triggers()
UnboundCommandMethodDecorator
BoundCommandMethodDecorator
MetaAggregate
Aggregate
aggregate()
OriginatorIDError
OriginatorVersionError
VersionError
SnapshotProtocol
CanSnapshotAggregate
Snapshot
random()
TopicError
get_topic()
resolve_topic()
register_topic()
retry()
strtobool()
Environment
application
— Applications- Domain-driven design
- Application objects
- Simple example
- Repository
- Notification log
- Registering custom transcodings
- Saving multiple aggregates
- Event-sourced log
- Application configuration
- Configuring aggregate caching
- Configuring persistence
- Configuring compression
- Configuring encryption
- Snapshotting
- Classes
persistence
— Persistence- Requirements
- Overview
- Stored event
- Notification
- Tracking
- Recorders
- POPO module
- Transcoder
- Transcodings
- Mapper
- Compression
- Encryption
- Compression and encryption
- Event store
- Infrastructure factory
- SQLite module
- PostgreSQL module
- Other persistence modules
- Classes
Transcoding
Transcoder
JSONTranscoder
UUIDAsHex
DecimalAsStr
DatetimeAsISO
StoredEvent
Compressor
Cipher
Mapper
RecordConflictError
PersistenceError
InterfaceError
DatabaseError
DataError
OperationalError
IntegrityError
InternalError
ProgrammingError
NotSupportedError
AggregateRecorder
Notification
ApplicationRecorder
ProcessRecorder
Recording
EventStore
InfrastructureFactory
Tracking
Cursor
Connection
ConnectionPoolClosedError
ConnectionNotFromPoolError
ConnectionUnavailableError
ConnectionPool
POPOAggregateRecorder
POPOApplicationRecorder
POPOProcessRecorder
Factory
SQLiteCursor
SQLiteConnection
SQLiteConnectionPool
SQLiteAggregateRecorder
SQLiteApplicationRecorder
SQLiteProcessRecorder
Factory
system
— Event-driven systems- System of applications
- Single-threaded runner
- Multi-threaded runner
- Classes
Follower
RecordingEventReceiver
Leader
ProcessApplication
System
Runner
RunnerAlreadyStartedError
NotificationPullingError
NotificationConvertingError
EventProcessingError
SingleThreadedRunner
NewSingleThreadedRunner
MultiThreadedRunner
MultiThreadedRunnerThread
NewMultiThreadedRunner
PullingThread
ConvertingThread
ProcessingThread
NotificationLogReader
interface
— Interface