--- id: eventsourcing version: "9.5.4" license: unclear license_treatment: permissive maintenance: active --- # eventsourcing — Event sourcing in Python License: permissive · Maintenance: active · Downloads: 91.5K/mo ## What it is and what it does Eventsourcing provides a framework for building applications where every state change is recorded as an immutable event. Rather than storing current state directly, you define domain aggregates (like a Dog class) decorated with @event methods, then use an Application class to manage persistence and retrieval. The library handles event storage, replay, snapshotting, versioning, and optional encryption—supporting multiple backends (in-memory, SQLite, and external databases) configured through environment variables. The core workflow is: define domain models with event decorators, create an application class that orchestrates saves and queries, then run your code against any configured persistence layer. Built-in features include optimistic concurrency control, compression, application-level encryption for PII compliance, and notification-based projections for CQRS patterns. It requires Python 3.10+ and depends only on typing_extensions. Use it for: - Build audit-trail systems where every state change must be recorded and replayed for compliance or debugging - Implement CQRS architectures with separate read and write models using notifications and projections - Create domain-driven applications with strong consistency boundaries and event-based communication between aggregates - Develop distributed systems where event logs serve as the source of truth for replication across nodes - Encrypt sensitive domain events at the application level to meet GDPR or similar data protection requirements ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Eventsourcing is a Python library for implementing event sourcing, a design pattern where all application state changes are stored as a sequence of immutable events that can be replayed to reconstruct state. Yes. Eventsourcing is a mature, actively maintained library (stable since 2015, production-ready) with low install friction, no security vulnerabilities, and a permissive license. It's the right choice if you need event sourcing as a core pattern; if you're unsure whether event sourcing fits your problem, evaluate that architectural decision first before installing. ## Install pip install eventsourcing uv add eventsourcing poetry add eventsourcing ## Installing eventsourcing Before you install: Low friction: pure Python wheel with a single runtime dependency (typing_extensions). Actively maintained with a recent release 140 days ago and ongoing commits; repository shows 1681 stars and is not archived. License in practice: Permissive license allows commercial and private use without restriction; suitable for most projects without legal concern. Quickstart: pip install eventsourcing from eventsourcing.domain import Aggregate, event from eventsourcing.application import Application class Dog(Aggregate): @event('Registered') def __init__(self, name: str) -> None: self.name = name class DogSchool(Application): def register_dog(self, name: str): dog = Dog(name) self.save(dog) return dog.id school = DogSchool() dog_id = school.register_dog('Fido') Requires Python 3.10 or later; by default events are stored in memory using Python objects, but persistence modules can be configured via environment variables. Verify before relying: - Performance characteristics under high-volume event streams or with large aggregates - Scalability limits when using in-memory persistence versus external databases - Compatibility of encryption/compression features with all supported database adapters ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 91.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags event sourcing library, event store python, domain-driven design ddd, cqrs event sourcing, event replay state management, aggregate event sourcing, domain events python, event-sourcing, domain-driven-design, cqrs [View on SkillFed](https://skillfed.io/packages/eventsourcing) · [View on PyPI](https://pypi.org/project/eventsourcing/)