adiumentum 0.3.0__py3-none-any.whl → 0.3.1__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.
@@ -1,20 +1,40 @@
1
1
  import json
2
2
  import re
3
3
  from collections.abc import Callable, Iterable
4
- from typing import Literal, TypeAlias, cast
5
-
6
- from datethyme import Date, Time
4
+ from typing import Literal, Protocol, Self, TypeAlias, cast
7
5
 
8
6
  from .functional import lmap
9
7
  from .typing_utils import JSONDict, areinstances
10
8
 
9
+ class DateProtocol(Protocol):
10
+ year: int
11
+ month: int
12
+ day: int
13
+
14
+ @classmethod
15
+ def parse(cls, date_string: str) -> Self: ...
16
+
17
+ def __str__(self) -> str: ...
18
+
19
+
20
+ class TimeProtocol(Protocol):
21
+ hour: int
22
+ minute: int
23
+ second: float
24
+
25
+ @classmethod
26
+ def parse(cls, time_string: str) -> Self: ...
27
+
28
+ def __str__(self) -> str: ...
29
+
30
+
11
31
  MixedValidated: TypeAlias = (
12
32
  str
13
33
  | bool
14
34
  | int
15
35
  | float
16
- | Time
17
- | Date
36
+ | TimeProtocol
37
+ | DateProtocol
18
38
  | tuple[str, ...]
19
39
  | tuple[str, str]
20
40
  | tuple[float, float]
@@ -135,10 +155,10 @@ def cast_to_negative_score(s: str | bool) -> float:
135
155
  return score
136
156
 
137
157
 
138
- def cast_to_Date(s: str | bool) -> Date:
158
+ def cast_to_date(s: str | bool, date_class: type[DateProtocol]) -> DateProtocol:
139
159
  if isinstance(s, bool):
140
160
  raise TypeError
141
- return Date.model_validate(s)
161
+ return date_class.parse(s)
142
162
 
143
163
 
144
164
  def cast_to_stringtuple(s: str | bool) -> tuple[str, ...]:
@@ -160,10 +180,10 @@ def cast_as(
160
180
  "integer": cast_to_int,
161
181
  "float": cast_to_float,
162
182
  "minutes": cast_to_minutes,
163
- "time": Time.model_validate,
183
+ # "time": Time.model_validate, TODO: add later via injection
164
184
  "positiveScore": cast_to_positive_score,
165
185
  "negativeScore": cast_to_negative_score,
166
- "date": cast_to_Date,
186
+ # "date": cast_to_date, TODO: add later via injection
167
187
  "stringtuple": cast_to_stringtuple,
168
188
  }
169
189
  caster = dispatch[input_type]
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: adiumentum
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary:
5
5
  Author: Isaac Riley
6
6
  Author-email: Isaac Riley <yelircaasi@proton.me>
7
7
  Requires-Dist: pydantic>=2.11
8
8
  Requires-Dist: multipledispatch>=1
9
9
  Requires-Dist: loguru>=0.7.3
10
- Requires-Dist: datethyme>=0.4.0
11
10
  Requires-Python: >=3.11, <3.15
12
11
  Description-Content-Type: text/markdown
13
12
 
@@ -17,10 +17,10 @@ adiumentum/paths_manager.py,sha256=7098bf8bd71cbe93eb60eb8c145a3f02d3e3470c2f236
17
17
  adiumentum/performance_logging.py,sha256=bd0c42337fb5c77921700e5487d366ea103e8cd25825138962bfb44c1b54773b,1471
18
18
  adiumentum/pydantic_extensions.md,sha256=6f5fe7fc9f10e0f6a87e2861dd16d066892099542dbaca3764944c6a27635706,24936
19
19
  adiumentum/pydantic_extensions.py,sha256=8e49c80f4be42b71986ec93195172af2d83986598de3f1bffe4c64505dc03729,12599
20
- adiumentum/string_utils.py,sha256=88b6389b2cb8ed9a3d65c5ea506ffe852cff480ac287ecdc399dec1e45095a58,4862
20
+ adiumentum/string_utils.py,sha256=459576481a67d1f078ffcbb0606ba235d0694cb0911905174239312224953f66,5321
21
21
  adiumentum/timestamping.py,sha256=87729ac9dd7dac614fbb7bb1995e321bd860202a4c2f435e044f4af23dd545a0,556
22
22
  adiumentum/typing_utils.py,sha256=81e01e90a60fe397c5211493fb4446af5f59fbd4b364c98f377962f4bd67ff8b,3894
23
- adiumentum-0.3.0.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
24
- adiumentum-0.3.0.dist-info/entry_points.txt,sha256=8d158243687a1102f915d2091f19bdc1443ec58709954317c4edff9edb9e5be8,57
25
- adiumentum-0.3.0.dist-info/METADATA,sha256=9e6fb8f1c191d51f594457019bfc06043d6754b93ef6c7c1f82925d22eaeae2e,1136
26
- adiumentum-0.3.0.dist-info/RECORD,,
23
+ adiumentum-0.3.1.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
24
+ adiumentum-0.3.1.dist-info/entry_points.txt,sha256=8d158243687a1102f915d2091f19bdc1443ec58709954317c4edff9edb9e5be8,57
25
+ adiumentum-0.3.1.dist-info/METADATA,sha256=ca600da9feaa1c5346895161b9cd661cf894e05b2e8b601b6e082165a32c6afc,1104
26
+ adiumentum-0.3.1.dist-info/RECORD,,