Skip to main content

Event Sourcing with Python

Libray for python developers to help use of Event Sourcing Architecture for the persistence layer

Installation

This library is published in pypi, so you can install with pip:

pip install evsrc

Usage

The library has two main interfaces to implement at its application layer:

  • Aggregate: Every change in the aggregate is done by one event (ChangeEvent) and can notify it to any external observer.
  • ChangeEvent: The events shall implement a method apply_on where the argument is the aggregate and changes the state of it. It is recommended to be inside the class (yes, python allows that).

The persistence has been modeled as files in file systems. The events and snapshots of aggregates are stored as files. For this purpose, the developer should implement these interfaces or ports:

  • FileSystem: The units of storage are files (or file-like). This interface not only can be implemented with a operating system filesystem, but azure storage, amazon s3, redis,...
  • AggregateParser: Encode to bytes lists of aggregates and the inverse function(decode). It is recommended one by aggregate type.
  • EventBatchParser: Encode to bytes lists of EventRecords and the inverse function(decode). It is recommended one by aggregate type.

There are some apapters for the ports already implemented and available to developer:

  • InMemFileSystem: implementation in memory, useless unless you'll want quick integration tests.
  • PickleAggregateParser, PickleEventBatchParser: The parsing use pickle library to encoding and decoding bytes. Very easy!!!
  • JsonAggregateParser, JsonEventBatchParser: The parsing use json library to encoding and decoding bytes. Very important the concept of JDict which is a dict with string as keys and only jsonable tokens(bool, str, int, float, lists, jdict). It needs to embed

Metadata

Release files for evsrc 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evsrc 4.2.0
File Size Uploaded Provenance Actions
evsrc-4.2.0.tar.gz 49.6 kB Without provenance Details for evsrc-4.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for evsrc 4.2.0
File Interpreter ABI Platform Actions
evsrc-4.2.0-py3-none-any.whl Python 3 none any Details for evsrc-4.2.0-py3-none-any.whl

Total release size: 60.1 kB

Release files / evsrc-4.2.0.tar.gz

Download URL evsrc-4.2.0.tar.gz
Size 49.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0140d4ec87c9c420203ec5e91b3069a8878d5f56d2d8b71a131e76a572f9d763
BLAKE2b-256 checksum
How to use checksums
1488511fc7bba2fbd4e3ee45e86dd89aeca5a91aff11c444a52e21cdbe109002
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / evsrc-4.2.0-py3-none-any.whl

Download URL evsrc-4.2.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8688c4ec9f87c684b631b3c033a721e9923111a1d590f5d8f897c12fae454a3
BLAKE2b-256 checksum
How to use checksums
5ea3c9ac65b98e19aaf5c65355683b83375f0b89a02328e2916a5c745de84e94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for evsrc 4.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page