Install & Compatibility
Where this runs
tested against v9.5.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.080s · 19.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.074s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Aggregate
✓ from eventsourcing.domain import Aggregate
✗ from eventsourcing.aggregate import Aggregate
Aggregate moved to eventsourcing.domain in v9.
Event
✓ from eventsourcing.domain import Event
✗ from eventsourcing.event import Event
Event classes are in eventsourcing.domain.
Application
✓ from eventsourcing.application import Application
✗ from eventsourcing.app import Application
Application has been in eventsourcing.application since early versions.
LogEvent
✓ from eventsourcing.domain import LogEvent
✗ from eventsourcing.events import LogEvent
LogEvent is part of the domain module.
Minimal example: define an aggregate with events, an application, and execute.
import os
from eventsourcing.application import Application
from eventsourcing.domain import Aggregate, event
class Dog(Aggregate):
@event('Registered')
def __init__(self, name):
self.name = name
self.tricks = []
@event('TrickAdded')
def add_trick(self, trick):
self.tricks.append(trick)
class DogSchool(Application):
def register_dog(self, name):
dog = Dog(name)
self.save(dog)
return dog.id
def add_trick(self, dog_id, trick):
dog = self.repository.get(dog_id)
dog.add_trick(trick)
self.save(dog)
def get_dog(self, dog_id):
return self.repository.get(dog_id)
app = DogSchool()
dog_id = app.register_dog('Fido')
app.add_trick(dog_id, 'roll over')
dog = app.get_dog(dog_id)
print(f'{dog.name}: {dog.tricks}')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'eventsourcing.aggregate'
Aggregate class moved to eventsourcing.domain in v9.
fixUse 'from eventsourcing.domain import Aggregate'.
TypeError: Can't instantiate abstract class Dog with abstract methods
Domain aggregate class missing @event decorator on __init__.
fixAdd '@event('Registered')' above __init__. AttributeError: 'Dog' object has no attribute 'save'
Calling save on the aggregate instance directly instead of through application.
fixUse 'self.save(dog)' inside the Application method, not dog.save()
Upgrade
Version history
9.5.4latest on PyPI · released Mar 27, 2026
Audit
Dependencies
No dependency data recorded yet.