fmtr.tools 1.3.69__py3-none-any.whl → 1.3.71__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 fmtr.tools might be problematic. Click here for more details.
- fmtr/tools/data_modelling_tools.py +9 -5
- fmtr/tools/datatype_tools.py +6 -2
- fmtr/tools/version +1 -1
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/METADATA +50 -50
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/RECORD +9 -9
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/WHEEL +0 -0
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/entry_points.txt +0 -0
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/licenses/LICENSE +0 -0
- {fmtr_tools-1.3.69.dist-info → fmtr_tools-1.3.71.dist-info}/top_level.txt +0 -0
|
@@ -5,9 +5,10 @@ from typing import ClassVar, List, Any, Dict
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
6
|
from pydantic import RootModel, ConfigDict
|
|
7
7
|
from pydantic.fields import FieldInfo
|
|
8
|
+
from pydantic.json_schema import SkipJsonSchema
|
|
8
9
|
from pydantic_core import PydanticUndefined, PydanticUndefinedType
|
|
9
10
|
|
|
10
|
-
from fmtr.tools.datatype_tools import is_optional
|
|
11
|
+
from fmtr.tools.datatype_tools import is_optional, none_else
|
|
11
12
|
from fmtr.tools.iterator_tools import get_class_lookup
|
|
12
13
|
from fmtr.tools.string_tools import camel_to_snake
|
|
13
14
|
from fmtr.tools.tools import Auto, Required, Empty
|
|
@@ -21,14 +22,14 @@ class Field(FieldInfo):
|
|
|
21
22
|
"""
|
|
22
23
|
NAME = Auto
|
|
23
24
|
ANNOTATION = Empty
|
|
24
|
-
EXCLUDE = False
|
|
25
25
|
DEFAULT = Auto
|
|
26
26
|
FILLS = None
|
|
27
27
|
DESCRIPTION = None
|
|
28
28
|
TITLE = Auto
|
|
29
|
+
SKIP_SCHEMA = False
|
|
29
30
|
CONFIG = None
|
|
30
31
|
|
|
31
|
-
def __init__(self, annotation=Empty, default=Empty, description=None, title=None, fills=None,
|
|
32
|
+
def __init__(self, annotation=Empty, default=Empty, description=None, title=None, fills=None, skip_schema=None, **kwargs):
|
|
32
33
|
"""
|
|
33
34
|
|
|
34
35
|
Infer default from type annotation, if enabled, use class/argument fills to create titles/descriptions, etc.
|
|
@@ -38,12 +39,15 @@ class Field(FieldInfo):
|
|
|
38
39
|
fills_super = getattr(super(), 'FILLS', None)
|
|
39
40
|
self.fills = (fills_super or {}) | (self.FILLS or {}) | (fills or {})
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
skip_schema = none_else(skip_schema, self.SKIP_SCHEMA)
|
|
42
43
|
|
|
43
44
|
self.annotation = self.ANNOTATION if annotation is Empty else annotation
|
|
44
45
|
if self.annotation is Empty:
|
|
45
46
|
raise ValueError("Annotation must be specified.")
|
|
46
47
|
|
|
48
|
+
if skip_schema:
|
|
49
|
+
self.annotation = SkipJsonSchema[self.annotation]
|
|
50
|
+
|
|
47
51
|
default = self.get_default_auto(default)
|
|
48
52
|
if default is Required:
|
|
49
53
|
default = PydanticUndefined
|
|
@@ -52,7 +56,7 @@ class Field(FieldInfo):
|
|
|
52
56
|
title = self.get_title_auto(title)
|
|
53
57
|
kwargs |= (self.CONFIG or {})
|
|
54
58
|
|
|
55
|
-
super().__init__(annotation=self.annotation, default=default, title=title, description=description,
|
|
59
|
+
super().__init__(annotation=self.annotation, default=default, title=title, description=description, **kwargs)
|
|
56
60
|
|
|
57
61
|
@classmethod
|
|
58
62
|
def get_name_auto(cls) -> str:
|
fmtr/tools/datatype_tools.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from types import UnionType, NoneType
|
|
2
|
-
from typing import Any, get_origin, get_args
|
|
2
|
+
from typing import Any, get_origin, get_args, Union, Annotated
|
|
3
3
|
|
|
4
4
|
from fmtr.tools.tools import Raise
|
|
5
5
|
|
|
@@ -98,5 +98,9 @@ def is_optional(annotation) -> bool:
|
|
|
98
98
|
|
|
99
99
|
origin = get_origin(annotation)
|
|
100
100
|
args = get_args(annotation)
|
|
101
|
-
|
|
101
|
+
|
|
102
|
+
if origin is Annotated:
|
|
103
|
+
return is_optional(args[0])
|
|
104
|
+
|
|
105
|
+
is_opt = (origin is UnionType or origin is Union) and NoneType in args
|
|
102
106
|
return is_opt
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.71
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.71
|
|
4
4
|
Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
|
|
5
5
|
Home-page: https://github.com/fmtr/fmtr.tools
|
|
6
6
|
Author: Frontmatter
|
|
@@ -168,68 +168,68 @@ Provides-Extra: db-document
|
|
|
168
168
|
Requires-Dist: beanie[odm]; extra == "db-document"
|
|
169
169
|
Requires-Dist: motor; extra == "db-document"
|
|
170
170
|
Provides-Extra: all
|
|
171
|
-
Requires-Dist:
|
|
172
|
-
Requires-Dist:
|
|
173
|
-
Requires-Dist: cachetools; extra == "all"
|
|
171
|
+
Requires-Dist: playwright; extra == "all"
|
|
172
|
+
Requires-Dist: ollama; extra == "all"
|
|
174
173
|
Requires-Dist: Unidecode; extra == "all"
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
174
|
+
Requires-Dist: cachetools; extra == "all"
|
|
175
|
+
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
176
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
177
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
178
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
179
|
+
Requires-Dist: python-on-whales; extra == "all"
|
|
177
180
|
Requires-Dist: beanie[odm]; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
179
|
-
Requires-Dist: pydantic; extra == "all"
|
|
180
|
-
Requires-Dist: httpx; extra == "all"
|
|
181
|
+
Requires-Dist: setuptools; extra == "all"
|
|
181
182
|
Requires-Dist: logfire[httpx]; extra == "all"
|
|
183
|
+
Requires-Dist: flet-video; extra == "all"
|
|
184
|
+
Requires-Dist: torchvision; extra == "all"
|
|
185
|
+
Requires-Dist: odfpy; extra == "all"
|
|
186
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
187
|
+
Requires-Dist: diskcache; extra == "all"
|
|
188
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
189
|
+
Requires-Dist: motor; extra == "all"
|
|
190
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
191
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
192
|
+
Requires-Dist: pandas; extra == "all"
|
|
193
|
+
Requires-Dist: google-auth; extra == "all"
|
|
194
|
+
Requires-Dist: json_repair; extra == "all"
|
|
195
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
196
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
197
|
+
Requires-Dist: openai; extra == "all"
|
|
198
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
182
199
|
Requires-Dist: pymupdf4llm; extra == "all"
|
|
183
|
-
Requires-Dist:
|
|
184
|
-
Requires-Dist:
|
|
200
|
+
Requires-Dist: logfire; extra == "all"
|
|
201
|
+
Requires-Dist: semver; extra == "all"
|
|
202
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
203
|
+
Requires-Dist: regex; extra == "all"
|
|
204
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
205
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
206
|
+
Requires-Dist: fastapi; extra == "all"
|
|
207
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
185
208
|
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
209
|
+
Requires-Dist: deepdiff; extra == "all"
|
|
186
210
|
Requires-Dist: dnspython[doh]; extra == "all"
|
|
187
|
-
Requires-Dist:
|
|
188
|
-
Requires-Dist:
|
|
189
|
-
Requires-Dist: google-api-python-client; extra == "all"
|
|
211
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
212
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
190
213
|
Requires-Dist: tokenizers; extra == "all"
|
|
191
|
-
Requires-Dist:
|
|
214
|
+
Requires-Dist: filetype; extra == "all"
|
|
215
|
+
Requires-Dist: pydantic; extra == "all"
|
|
216
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
217
|
+
Requires-Dist: faker; extra == "all"
|
|
192
218
|
Requires-Dist: flet[all]; extra == "all"
|
|
193
|
-
Requires-Dist:
|
|
194
|
-
Requires-Dist:
|
|
195
|
-
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
196
|
-
Requires-Dist: odfpy; extra == "all"
|
|
197
|
-
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
198
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
199
|
-
Requires-Dist: motor; extra == "all"
|
|
200
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
201
|
-
Requires-Dist: appdirs; extra == "all"
|
|
219
|
+
Requires-Dist: tabulate; extra == "all"
|
|
220
|
+
Requires-Dist: httpx; extra == "all"
|
|
202
221
|
Requires-Dist: peft; extra == "all"
|
|
203
|
-
Requires-Dist: setuptools; extra == "all"
|
|
204
222
|
Requires-Dist: flet-webview; extra == "all"
|
|
205
|
-
Requires-Dist:
|
|
206
|
-
Requires-Dist:
|
|
207
|
-
Requires-Dist: distributed; extra == "all"
|
|
208
|
-
Requires-Dist: torchaudio; extra == "all"
|
|
223
|
+
Requires-Dist: pycountry; extra == "all"
|
|
224
|
+
Requires-Dist: html2text; extra == "all"
|
|
209
225
|
Requires-Dist: sentence_transformers; extra == "all"
|
|
210
|
-
Requires-Dist:
|
|
226
|
+
Requires-Dist: appdirs; extra == "all"
|
|
227
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
228
|
+
Requires-Dist: distributed; extra == "all"
|
|
229
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
230
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
211
231
|
Requires-Dist: sre_yield; extra == "all"
|
|
212
|
-
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
213
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
214
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
215
|
-
Requires-Dist: semver; extra == "all"
|
|
216
232
|
Requires-Dist: bokeh; extra == "all"
|
|
217
|
-
Requires-Dist: python-on-whales; extra == "all"
|
|
218
|
-
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
219
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
220
|
-
Requires-Dist: tinynetrc; extra == "all"
|
|
221
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
222
|
-
Requires-Dist: torchvision; extra == "all"
|
|
223
|
-
Requires-Dist: html2text; extra == "all"
|
|
224
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
225
|
-
Requires-Dist: dask[bag]; extra == "all"
|
|
226
|
-
Requires-Dist: playwright; extra == "all"
|
|
227
|
-
Requires-Dist: faker; extra == "all"
|
|
228
|
-
Requires-Dist: filetype; extra == "all"
|
|
229
|
-
Requires-Dist: json_repair; extra == "all"
|
|
230
|
-
Requires-Dist: flet-video; extra == "all"
|
|
231
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
232
|
-
Requires-Dist: yamlscript; extra == "all"
|
|
233
233
|
Dynamic: author
|
|
234
234
|
Dynamic: author-email
|
|
235
235
|
Dynamic: description
|
|
@@ -5,9 +5,9 @@ fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCB
|
|
|
5
5
|
fmtr/tools/caching_tools.py,sha256=74p7m2GLFfeP41LX69wxgfkilxEAoWkMIfFMjKsYpyg,4976
|
|
6
6
|
fmtr/tools/constants.py,sha256=90wCirUpw4bWMAbjhip0LL6k57eS5VmxRUP9pLCChBg,1812
|
|
7
7
|
fmtr/tools/context_tools.py,sha256=4UvIHYgLqAh7dXMX9EBrLEpYp81qfzhSVrkffOSAoGA,350
|
|
8
|
-
fmtr/tools/data_modelling_tools.py,sha256=
|
|
8
|
+
fmtr/tools/data_modelling_tools.py,sha256=qTKyLlSOnFnkJTa2Wg3eRlec9kiKsrddrO2Zi9vZvqA,6188
|
|
9
9
|
fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
|
|
10
|
-
fmtr/tools/datatype_tools.py,sha256=
|
|
10
|
+
fmtr/tools/datatype_tools.py,sha256=qFPFrZK70-an4w7H46g8eT5j6Jez--U2XnmFdrQibeE,1983
|
|
11
11
|
fmtr/tools/datetime_tools.py,sha256=L7wmBoQbD9h_pJIL92WQOX32r_vrXgRvE-_0PVPRAGY,232
|
|
12
12
|
fmtr/tools/debugging_tools.py,sha256=_xzqS0V5BpL8d06j-jVQjGgI7T020QsqVXKAKMz7Du8,2082
|
|
13
13
|
fmtr/tools/environment_tools.py,sha256=43uqfj1G1bNX0IwKz-NKbu3AbFYSdbBuGN9rlThe030,1845
|
|
@@ -45,7 +45,7 @@ fmtr/tools/tabular_tools.py,sha256=mw6vOij1Ch-pVAyHMPtm5zj__ULZN_TKeBYOfj33wFM,1
|
|
|
45
45
|
fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
|
|
46
46
|
fmtr/tools/tools.py,sha256=sLMXk8juOL8_n_D776cJ-kzjyMHqFI_fctDEjy6PIKs,1115
|
|
47
47
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
48
|
-
fmtr/tools/version,sha256=
|
|
48
|
+
fmtr/tools/version,sha256=RKfpJYVUZqgI7UFHG-wGYsY7K7pJ5MVrkwjYpSOb6ro,6
|
|
49
49
|
fmtr/tools/webhook_tools.py,sha256=q3pVJ1NCem2SrMuFcLxiWd7DibFs7Q-uGtojfXd3Qcg,380
|
|
50
50
|
fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
|
|
51
51
|
fmtr/tools/ai_tools/__init__.py,sha256=O8VRlPnnQCncg2ZZ2l_VdWLJf4jkKH6dkZFVbv6o7IM,388
|
|
@@ -85,9 +85,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
|
|
|
85
85
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
86
86
|
fmtr/tools/version_tools/__init__.py,sha256=cjE6nO6AoVOUp3RwgTbqL9wiw8J1l2pHJOz6Gn6bxjA,326
|
|
87
87
|
fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
|
|
88
|
-
fmtr_tools-1.3.
|
|
89
|
-
fmtr_tools-1.3.
|
|
90
|
-
fmtr_tools-1.3.
|
|
91
|
-
fmtr_tools-1.3.
|
|
92
|
-
fmtr_tools-1.3.
|
|
93
|
-
fmtr_tools-1.3.
|
|
88
|
+
fmtr_tools-1.3.71.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
89
|
+
fmtr_tools-1.3.71.dist-info/METADATA,sha256=t-oB0K3EpWbRCOh4g-3xeK7fmkfs1NM8BsudZY98i7Y,18035
|
|
90
|
+
fmtr_tools-1.3.71.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
91
|
+
fmtr_tools-1.3.71.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
|
|
92
|
+
fmtr_tools-1.3.71.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
|
|
93
|
+
fmtr_tools-1.3.71.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|