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
- Avoiding repetition
- 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
- Registering topics
- Explicit topics
- Versioning
- Snapshots
- Notes
- Code reference
TZINFO
EventsourcingType
DomainEventProtocol
MutableAggregateProtocol
ImmutableAggregateProtocol
MutableOrImmutableAggregate
TMutableOrImmutableAggregate
CollectEventsProtocol
CanMutateProtocol
datetime_now_with_tzinfo()
create_utc_datetime_now()
CanCreateTimestamp
HasOriginatorIDVersion
CanMutateAggregate
CanInitAggregate
MetaDomainEvent
DomainEvent
AggregateEvent
AggregateCreated
EventSourcingError
ProgrammingError
LogEvent
event()
triggers()
UnboundCommandMethodDecorator
BoundCommandMethodDecorator
DecoratorEvent
MetaAggregate
BaseAggregate
OriginatorIDError
OriginatorVersionError
SnapshotProtocol
CanSnapshotAggregate
Snapshot
Aggregate
aggregate()
random()
TopicError
get_topic()
resolve_topic()
register_topic()
retry()
strtobool()
Environment
singledispatchmethod
application
— Applications- Domain-driven design
- Application objects
- Simple example
- Repository
- Notification log
- Mappers, transcoders and transcodings
- Saving multiple aggregates
- Event-sourced log
- Application configuration
- Configuring aggregate caching
- Configuring persistence
- Configuring compression
- Configuring encryption
- Snapshotting
- Code reference
persistence
— Persistence- Requirements
- Overview
- Stored event
- Transcoder
- Transcodings
- Mapper
- Compression
- Encryption
- Compression and encryption
- Notification
- Tracking
- Recorders
- Persistence modules
- Event store
- Infrastructure factory
- Code reference
Transcoding
Transcoder
TranscodingNotRegisteredError
JSONTranscoder
UUIDAsHex
DecimalAsStr
DatetimeAsISO
StoredEvent
Compressor
Cipher
MapperDeserialisationError
Mapper
RecordConflictError
PersistenceError
InterfaceError
DatabaseError
DataError
OperationalError
IntegrityError
InternalError
ProgrammingError
NotSupportedError
WaitInterruptedError
AggregateRecorder
Notification
ApplicationRecorder
TrackingRecorder
ProcessRecorder
Recording
EventStore
InfrastructureFactoryError
InfrastructureFactory
Tracking
Cursor
Connection
ConnectionPoolClosedError
ConnectionNotFromPoolError
ConnectionUnavailableError
ConnectionPool
Subscription
ListenNotifySubscription
POPOAggregateRecorder
POPOApplicationRecorder
POPOSubscription
POPOTrackingRecorder
POPOProcessRecorder
POPOFactory
Factory
SQLiteCursor
SQLiteConnection
SQLiteConnectionPool
SQLiteAggregateRecorder
SQLiteApplicationRecorder
SQLiteTrackingRecorder
SQLiteProcessRecorder
SQLiteFactory
Factory
ConnectionPool
PostgresDatastore
PostgresRecorder
PostgresAggregateRecorder
PostgresApplicationRecorder
PostgresSubscription
PostgresTrackingRecorder
PostgresProcessRecorder
PostgresFactory
Factory
projection
— Projectionssystem
— Event-driven systems- System of applications
- Single-threaded runner
- Multi-threaded runner
- Code reference
RecordingEvent
Follower
RecordingEventReceiver
Leader
ProcessApplication
System
Runner
RunnerAlreadyStartedError
NotificationPullingError
NotificationConvertingError
EventProcessingError
SingleThreadedRunner
NewSingleThreadedRunner
MultiThreadedRunner
MultiThreadedRunnerThread
NewMultiThreadedRunner
PullingThread
ConvertingThread
ProcessingThread
NotificationLogReader
interface
— Interface