eventsourcing 9.4.4__py3-none-any.whl → 9.4.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eventsourcing might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eventsourcing
3
- Version: 9.4.4
3
+ Version: 9.4.6
4
4
  Summary: Event sourcing in Python
5
5
  License: BSD-3-Clause
6
6
  Keywords: event sourcing,event store,domain driven design,domain-driven design,ddd,cqrs,cqs
@@ -54,6 +54,8 @@ experience. Please [read the docs](https://eventsourcing.readthedocs.io/). See a
54
54
 
55
55
  *"a huge help and time saver"*
56
56
 
57
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/pyeventsourcing/eventsourcing)
58
+
57
59
 
58
60
  ## Installation
59
61
 
@@ -75,40 +77,44 @@ from eventsourcing.domain import Aggregate, event
75
77
 
76
78
  class Dog(Aggregate):
77
79
  @event('Registered')
78
- def __init__(self, name):
80
+ def __init__(self, name: str) -> None:
79
81
  self.name = name
80
- self.tricks = []
82
+ self.tricks: list[str] = []
81
83
 
82
84
  @event('TrickAdded')
83
- def add_trick(self, trick):
85
+ def add_trick(self, trick: str) -> None:
84
86
  self.tricks.append(trick)
85
87
  ```
86
88
 
87
89
  Define application objects with the `Application` class.
88
90
 
89
91
  ```python
92
+ from typing import Any
93
+ from uuid import UUID
94
+
90
95
  from eventsourcing.application import Application
91
96
 
92
- class DogSchool(Application):
93
- def register_dog(self, name):
97
+
98
+ class DogSchool(Application[UUID]):
99
+ def register_dog(self, name: str) -> UUID:
94
100
  dog = Dog(name)
95
101
  self.save(dog)
96
102
  return dog.id
97
103
 
98
- def add_trick(self, dog_id, trick):
99
- dog = self.repository.get(dog_id)
104
+ def add_trick(self, dog_id: UUID, trick: str) -> None:
105
+ dog: Dog = self.repository.get(dog_id)
100
106
  dog.add_trick(trick)
101
107
  self.save(dog)
102
108
 
103
- def get_dog(self, dog_id):
104
- dog = self.repository.get(dog_id)
109
+ def get_dog(self, dog_id: UUID) -> dict[str, Any]:
110
+ dog: Dog = self.repository.get(dog_id)
105
111
  return {'name': dog.name, 'tricks': tuple(dog.tricks)}
106
112
  ```
107
113
 
108
114
  Write a test.
109
115
 
110
116
  ```python
111
- def test_dog_school():
117
+ def test_dog_school() -> None:
112
118
  # Construct application object.
113
119
  school = DogSchool()
114
120
 
@@ -140,7 +146,7 @@ Configure the application to run with an SQLite database. Other persistence modu
140
146
  import os
141
147
 
142
148
  os.environ["PERSISTENCE_MODULE"] = 'eventsourcing.sqlite'
143
- os.environ["SQLITE_DBNAME"] = 'dog-school.db'
149
+ os.environ["SQLITE_DBNAME"] = ':memory:'
144
150
  ```
145
151
 
146
152
  Run the test with SQLite.
@@ -0,0 +1,26 @@
1
+ eventsourcing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ eventsourcing/application.py,sha256=4oazKGZxIqJRw9vgkmcyKSD-aFwOCo7ZVMrVWl4WUcE,36747
3
+ eventsourcing/cipher.py,sha256=ulTBtX5K9ejRAkdUaUbdIaj4H7anYwDOi7JxOolj2uo,3295
4
+ eventsourcing/compressor.py,sha256=qEYWvsUXFLyhKgfuv-HGNJ6VF4sRw4z0IxbNW9ukOfc,385
5
+ eventsourcing/cryptography.py,sha256=aFZLlJxxSb5seVbh94-T8FA_RIGOe-VFu5SJrbOnwUU,2969
6
+ eventsourcing/dispatch.py,sha256=-yI-0EpyXnpMBkciTHNPlxSHJebUe7Ko9rT-gdOjoIo,2797
7
+ eventsourcing/domain.py,sha256=4MxGMciBiwpn_74e_4iBol7EIHjxMzeD-tk75cg3_XM,74100
8
+ eventsourcing/interface.py,sha256=K7tAJjriOJa_XB9-wptJR9VTb5sHlBpqrz3BGUXxI4A,5387
9
+ eventsourcing/persistence.py,sha256=-jxbXkEHjVgFGWg37Zj_25Z77c7b11V-bwZb1VObjxA,49892
10
+ eventsourcing/popo.py,sha256=plnBf4NItCpjOdQgErUlme6QgIlZS0o7nSqc_cpHZ_E,9201
11
+ eventsourcing/postgres.py,sha256=4G_vJ8ojhegZtp7AUCedQitLCdksWTm0HZlyveofyYs,43819
12
+ eventsourcing/projection.py,sha256=iSNSRMEJO3W6NspNDZRk68ABkOXkmiNolkA41QYVNXk,14962
13
+ eventsourcing/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ eventsourcing/sqlite.py,sha256=Es1pqkwckpPAwE0iE4rCj94wNC3iTjPbx-lWPiv2z9A,27053
15
+ eventsourcing/system.py,sha256=JG9JudGCbnSSF9N9UHBYCQT-zUgL2XXw0As3TGsGLDo,45933
16
+ eventsourcing/tests/__init__.py,sha256=FtOyuj-L-oSisYeByTIrnUw-XzsctSbq76XmjPy5fMc,102
17
+ eventsourcing/tests/application.py,sha256=lzdV8QXhhP4PH_BOieceKORSoKWBPz3vyF5Q8EzAIBU,17970
18
+ eventsourcing/tests/domain.py,sha256=yN-F6gMRumeX6nIXIcZGxAR3RrUslzmEMM8JksnkI8Q,3227
19
+ eventsourcing/tests/persistence.py,sha256=S_tv4fah-gmaYpDcWOAEgfScdqrMlERTbvsz1yQzI30,64110
20
+ eventsourcing/tests/postgres_utils.py,sha256=c2QYnF7meT7uSalAvHL1qS9al5fFNmwF7HW-wnGu0bs,2327
21
+ eventsourcing/utils.py,sha256=NFluYSGq6_3gNi0PSU_zomTgsBwJmULXAgW8DSVXiX4,8581
22
+ eventsourcing-9.4.6.dist-info/AUTHORS,sha256=8aHOM4UbNZcKlD-cHpFRcM6RWyCqtwtxRev6DeUgVRs,137
23
+ eventsourcing-9.4.6.dist-info/LICENSE,sha256=CQEQzcZO8AWXL5i3hIo4yVKrYjh2FBz6hCM7kpXWpw4,1512
24
+ eventsourcing-9.4.6.dist-info/METADATA,sha256=Tt1A4JWVGVaGXEa4IFYjZrYL9BruP6Sz_TeuDcYnpBI,10265
25
+ eventsourcing-9.4.6.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
26
+ eventsourcing-9.4.6.dist-info/RECORD,,
@@ -1,26 +0,0 @@
1
- eventsourcing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- eventsourcing/application.py,sha256=K3M9_Rh2jaYzBDPMvmyemLXHQ4GsGfGsxmMfUeVSqXw,35507
3
- eventsourcing/cipher.py,sha256=ulTBtX5K9ejRAkdUaUbdIaj4H7anYwDOi7JxOolj2uo,3295
4
- eventsourcing/compressor.py,sha256=qEYWvsUXFLyhKgfuv-HGNJ6VF4sRw4z0IxbNW9ukOfc,385
5
- eventsourcing/cryptography.py,sha256=aFZLlJxxSb5seVbh94-T8FA_RIGOe-VFu5SJrbOnwUU,2969
6
- eventsourcing/dispatch.py,sha256=-yI-0EpyXnpMBkciTHNPlxSHJebUe7Ko9rT-gdOjoIo,2797
7
- eventsourcing/domain.py,sha256=2c33FfhVIBcUzhJa6TMhGPDwOma-wGiPHUL8RC8ZokQ,62967
8
- eventsourcing/interface.py,sha256=-VLoqcd9a0PXpD_Bv0LjCiG21xLREG6tXK6phgtShOw,5035
9
- eventsourcing/persistence.py,sha256=LrIjdEmMhM2Pz_ozGO_uOAQ099-yW92htaxO63vntwA,46406
10
- eventsourcing/popo.py,sha256=8LvOmAdwVRArhvWVsmfeHSmZ4B1CVdlR2KggwVbmeWU,9131
11
- eventsourcing/postgres.py,sha256=e1UGfc1qIX4RxLmUzneT3rjsV75Cres06Uckbrv4euo,43741
12
- eventsourcing/projection.py,sha256=X73BHLq37bXNm9FpNYA3O1plqPunxQmi-vu0DuFiugw,14727
13
- eventsourcing/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- eventsourcing/sqlite.py,sha256=8GJ6rKhX1z6CN0gXQIn6wh5pWmGvzOuMHtxcp0bO1SE,26696
15
- eventsourcing/system.py,sha256=WCfuSc45A9A1fFO7zpDum_ddh4pU7x-vEcpVZ_ycAyE,44358
16
- eventsourcing/tests/__init__.py,sha256=FtOyuj-L-oSisYeByTIrnUw-XzsctSbq76XmjPy5fMc,102
17
- eventsourcing/tests/application.py,sha256=pAn9Cugp_1rjOtj_nruGhh7PxdrQWibDlrnOAlOKXwo,20614
18
- eventsourcing/tests/domain.py,sha256=yN-F6gMRumeX6nIXIcZGxAR3RrUslzmEMM8JksnkI8Q,3227
19
- eventsourcing/tests/persistence.py,sha256=TMi4gnlBfcd7XqFlWPSsNxwnEKhaPpXu-dHHgqJUs4I,60816
20
- eventsourcing/tests/postgres_utils.py,sha256=y-2ZrCZtHPqjfvBQqahtbTvvasFX2GGaMikG1BSK81A,1444
21
- eventsourcing/utils.py,sha256=pOnczXzaE5q7UbQbPmgcpWaP660fsmfiDJs6Gmo8QCM,8558
22
- eventsourcing-9.4.4.dist-info/AUTHORS,sha256=8aHOM4UbNZcKlD-cHpFRcM6RWyCqtwtxRev6DeUgVRs,137
23
- eventsourcing-9.4.4.dist-info/LICENSE,sha256=CQEQzcZO8AWXL5i3hIo4yVKrYjh2FBz6hCM7kpXWpw4,1512
24
- eventsourcing-9.4.4.dist-info/METADATA,sha256=C2sTYGk8meFDKMJn_w7GvoG37_9MHGMmJUgtWYhmvys,10003
25
- eventsourcing-9.4.4.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
26
- eventsourcing-9.4.4.dist-info/RECORD,,