fable-model 0.2.1__tar.gz → 0.3.0__tar.gz

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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fable-model
3
- Version: 0.2.1
4
- Summary: Data models utilized in the FABLE ecosystem's HTTP-based PPRL service.
3
+ Version: 0.3.0
4
+ Summary: Data models utilized in the FABLE ecosystem's HTTP-based services.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
7
7
  Keywords: record linkage,privacy,bloom filter
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.14
19
+ Requires-Dist: packaging (>=26.3,<27.0)
19
20
  Requires-Dist: pydantic (>=2.7.0,<3.0.0)
20
21
  Project-URL: Repository, https://github.com/ul-mds/fable-model
21
22
  Description-Content-Type: text/markdown
@@ -1,4 +1,4 @@
1
- from .common import BitVectorEntity, AttributeValueEntity, HealthResponse
1
+ from .common import BitVectorEntity, AttributeValueEntity, HealthResponse, ServiceBaseInformation
2
2
  from .mask import (
3
3
  HashStrategy,
4
4
  DoubleHash,
@@ -58,6 +58,24 @@ from .transform import (
58
58
  EntityTransformResponse,
59
59
  BaseTransformRequest,
60
60
  )
61
+ from .broker import (
62
+ BaseSessionModel,
63
+ BaseAuthenticatedSessionModel,
64
+ SessionCreationRequest,
65
+ SessionUpdateRequest,
66
+ SessionCreationResponse,
67
+ SessionDeletionRequest,
68
+ SessionUpdateResponse,
69
+ BitVectorMetadata,
70
+ MetaBitVectorEntity,
71
+ BaseClientModel,
72
+ ClientSubmissionRequest,
73
+ ClientVectorBatch,
74
+ VectorMatchBatch,
75
+ ClientResultRequest,
76
+ MatchedClientVector,
77
+ ClientResultResponse,
78
+ )
61
79
 
62
80
  __all__ = [
63
81
  "BitVectorEntity",
@@ -119,4 +137,21 @@ __all__ = [
119
137
  "BaseMatchRequest",
120
138
  "MatchMethod",
121
139
  "SimilarityAggregator",
140
+ "BaseSessionModel",
141
+ "BaseAuthenticatedSessionModel",
142
+ "SessionCreationRequest",
143
+ "SessionUpdateRequest",
144
+ "SessionCreationResponse",
145
+ "SessionDeletionRequest",
146
+ "SessionUpdateResponse",
147
+ "BitVectorMetadata",
148
+ "MetaBitVectorEntity",
149
+ "BaseClientModel",
150
+ "ClientSubmissionRequest",
151
+ "ClientVectorBatch",
152
+ "VectorMatchBatch",
153
+ "ClientResultRequest",
154
+ "MatchedClientVector",
155
+ "ClientResultResponse",
156
+ "ServiceBaseInformation",
122
157
  ]
@@ -50,7 +50,7 @@ class ClientSubmissionRequest(BaseClientModel):
50
50
 
51
51
  class ClientVectorBatch(BaseModel):
52
52
  client: str
53
- ids: list[int]
53
+ ids: list[str]
54
54
 
55
55
 
56
56
  class VectorMatchBatch(BaseModel):
@@ -0,0 +1,35 @@
1
+ from typing import Annotated, Literal
2
+
3
+ from packaging.version import Version, InvalidVersion
4
+ from pydantic import BaseModel, ConfigDict, BeforeValidator
5
+
6
+
7
+ class ParentModel(BaseModel):
8
+ model_config = ConfigDict(extra="forbid")
9
+
10
+
11
+ class AttributeValueEntity(ParentModel):
12
+ id: str
13
+ attributes: dict[str, str]
14
+
15
+
16
+ class BitVectorEntity(ParentModel):
17
+ id: str
18
+ value: str
19
+
20
+
21
+ class HealthResponse(ParentModel):
22
+ status: Literal["ok"] = "ok"
23
+
24
+
25
+ def _validate_version(value: str) -> str:
26
+ try:
27
+ Version(value)
28
+ except InvalidVersion as e:
29
+ raise ValueError(f"Invalid version: {value!r}") from e
30
+
31
+ return value
32
+
33
+
34
+ class ServiceBaseInformation(ParentModel):
35
+ version: Annotated[str, BeforeValidator(_validate_version)]
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "fable-model"
3
- version = "0.2.1"
4
- description = "Data models utilized in the FABLE ecosystem's HTTP-based PPRL service."
3
+ version = "0.3.0"
4
+ description = "Data models utilized in the FABLE ecosystem's HTTP-based services."
5
5
  authors = [
6
6
  {name = "Maximilian Jugl"},
7
7
  {name = "Paul Brassel", email = "paul.brassel@medizin.uni-leipzig.de"}
@@ -9,7 +9,8 @@ authors = [
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
11
  dependencies = [
12
- "pydantic (>=2.7.0,<3.0.0)"
12
+ "pydantic (>=2.7.0,<3.0.0)",
13
+ "packaging (>=26.3,<27.0)"
13
14
  ]
14
15
  license = "MIT"
15
16
  classifiers = [
@@ -39,18 +40,15 @@ markers = [
39
40
  "integration: mark a test as an integration test."
40
41
  ]
41
42
 
42
- [tool.coverage.run]
43
- omit = [
44
- "fable_model/broker.py",
45
- ]
46
-
47
43
  [build-system]
48
44
  requires = ["poetry-core>=2.0.0,<3.0.0"]
49
45
  build-backend = "poetry.core.masonry.api"
50
46
 
51
- [tool.poetry.group.dev.dependencies]
52
- ruff = ">=0.15.0"
53
- pytest = ">=8.3.0"
54
- pytest-cov = "^7.1.0"
55
- pre-commit = "^4.6.0"
56
- readme-coverage-badger = "^1.1.0"
47
+ [dependency-groups]
48
+ dev = [
49
+ "ruff (>=0.15.0,<0.16.0)",
50
+ "pytest (>=9.1.1,<10.0.0)",
51
+ "pytest-cov (>=7.1.0,<8.0.0)",
52
+ "pre-commit (>=4.6.1,<5.0.0)",
53
+ "readme-coverage-badger (>=1.1.0,<2.0.0)"
54
+ ]
@@ -1,21 +0,0 @@
1
- from typing import Literal
2
-
3
- from pydantic import BaseModel, ConfigDict
4
-
5
-
6
- class ParentModel(BaseModel):
7
- model_config = ConfigDict(extra="forbid")
8
-
9
-
10
- class AttributeValueEntity(ParentModel):
11
- id: str
12
- attributes: dict[str, str]
13
-
14
-
15
- class BitVectorEntity(ParentModel):
16
- id: str
17
- value: str
18
-
19
-
20
- class HealthResponse(ParentModel):
21
- status: Literal["ok"] = "ok"
File without changes
File without changes