Event Sourcing library using python
Project description
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 methodapply_onwhere 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 usepicklelibrary to encoding and decoding bytes. Very easy!!!JsonAggregateParser,JsonEventBatchParser: The parsing usejsonlibrary 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evsrc-4.0.7.tar.gz.
File metadata
- Download URL: evsrc-4.0.7.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66dbc5ab9513dc0512c5ff7d8626ea43c2ebaab6e6998f9eb2a77b487fed7113
|
|
| MD5 |
ca952f60e1b7025ee32fb8f738d9555a
|
|
| BLAKE2b-256 |
3d7ea16e6201d967b0c9336e61ba718229729f74a139b07dc3b22a62db327be8
|
File details
Details for the file evsrc-4.0.7-py3-none-any.whl.
File metadata
- Download URL: evsrc-4.0.7-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca146571d71e2f2a2ade5fe8c62831d3b71de3957e23f21600e5e94b12d753fd
|
|
| MD5 |
691f7efda470517a637fef82016602ce
|
|
| BLAKE2b-256 |
f4b65b471e25c7e33adeb632eec45d42ab2d43f21fd7188d75964e75b7071d44
|