fmtr.tools 1.3.66__tar.gz → 1.3.68__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.
Potentially problematic release.
This version of fmtr.tools might be problematic. Click here for more details.
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/PKG-INFO +51 -51
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/data_modelling_tools.py +47 -24
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/datatype_tools.py +3 -0
- fmtr_tools-1.3.68/fmtr/tools/version +1 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/PKG-INFO +51 -51
- fmtr_tools-1.3.66/fmtr/tools/version +0 -1
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/LICENSE +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/README.md +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/ai_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/ai_tools/agentic_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/ai_tools/inference_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/api_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/async_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/caching_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/constants.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/context_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/database_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/database_tools/document.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/datetime_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/debugging_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dns_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dns_tools/client.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dns_tools/dm.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dns_tools/proxy.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/dns_tools/server.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/docker_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/cache_hfh.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/ep_test.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/install_yamlscript.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/remote_debug_test.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/entrypoints/shell_debug.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/environment_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/function_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/hash_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/html_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/http_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/import_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/inherit_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/interface_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/interface_tools/context.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/interface_tools/controls.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/interface_tools/interface_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/iterator_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/json_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/logging_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/merging_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/metric_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/name_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/openai_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/packaging_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/path_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/path_tools/app_path_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/path_tools/path_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/path_tools/type_path_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/pattern_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/pdf_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/platform_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/process_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/random_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/settings_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/setup_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/setup_tools/setup_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/string_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tabular_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/version_tools/__init__.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/version_tools/version_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/webhook_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/requires.txt +50 -50
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/pyproject.toml +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/setup.cfg +0 -0
- {fmtr_tools-1.3.66 → fmtr_tools-1.3.68}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.68
|
|
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:
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist:
|
|
171
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
172
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
173
|
+
Requires-Dist: appdirs; extra == "all"
|
|
174
|
+
Requires-Dist: python-on-whales; extra == "all"
|
|
175
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
176
|
+
Requires-Dist: motor; extra == "all"
|
|
177
|
+
Requires-Dist: pycountry; extra == "all"
|
|
178
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
179
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
180
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
181
|
+
Requires-Dist: json_repair; extra == "all"
|
|
182
|
+
Requires-Dist: httpx; extra == "all"
|
|
183
|
+
Requires-Dist: google-auth; extra == "all"
|
|
184
|
+
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
185
|
+
Requires-Dist: beanie[odm]; extra == "all"
|
|
186
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
176
187
|
Requires-Dist: playwright; extra == "all"
|
|
177
188
|
Requires-Dist: flet-video; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
189
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
190
|
+
Requires-Dist: semver; extra == "all"
|
|
181
191
|
Requires-Dist: pandas; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist: regex; extra == "all"
|
|
184
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
185
|
-
Requires-Dist: yamlscript; extra == "all"
|
|
186
|
-
Requires-Dist: Unidecode; extra == "all"
|
|
187
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
188
|
-
Requires-Dist: google-api-python-client; extra == "all"
|
|
189
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
192
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
190
193
|
Requires-Dist: tinynetrc; extra == "all"
|
|
194
|
+
Requires-Dist: cachetools; extra == "all"
|
|
195
|
+
Requires-Dist: logfire; extra == "all"
|
|
196
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
197
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
198
|
+
Requires-Dist: setuptools; extra == "all"
|
|
191
199
|
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
192
|
-
Requires-Dist:
|
|
193
|
-
Requires-Dist:
|
|
194
|
-
Requires-Dist:
|
|
195
|
-
Requires-Dist:
|
|
200
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
201
|
+
Requires-Dist: peft; extra == "all"
|
|
202
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
203
|
+
Requires-Dist: bokeh; extra == "all"
|
|
204
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
205
|
+
Requires-Dist: odfpy; extra == "all"
|
|
206
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
207
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
208
|
+
Requires-Dist: ollama; extra == "all"
|
|
209
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
196
210
|
Requires-Dist: diskcache; extra == "all"
|
|
197
|
-
Requires-Dist:
|
|
211
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
212
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
198
213
|
Requires-Dist: deepdiff; extra == "all"
|
|
199
|
-
Requires-Dist:
|
|
200
|
-
Requires-Dist:
|
|
201
|
-
Requires-Dist:
|
|
202
|
-
Requires-Dist: faker; extra == "all"
|
|
203
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
204
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
214
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
215
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
216
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
205
217
|
Requires-Dist: sre_yield; extra == "all"
|
|
206
|
-
Requires-Dist:
|
|
207
|
-
Requires-Dist: tabulate; extra == "all"
|
|
208
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
218
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
209
219
|
Requires-Dist: fastapi; extra == "all"
|
|
210
|
-
Requires-Dist:
|
|
211
|
-
Requires-Dist:
|
|
212
|
-
Requires-Dist:
|
|
213
|
-
Requires-Dist:
|
|
214
|
-
Requires-Dist:
|
|
215
|
-
Requires-Dist: appdirs; extra == "all"
|
|
216
|
-
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
220
|
+
Requires-Dist: regex; extra == "all"
|
|
221
|
+
Requires-Dist: openai; extra == "all"
|
|
222
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
223
|
+
Requires-Dist: torchvision; extra == "all"
|
|
224
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
217
225
|
Requires-Dist: pydantic; extra == "all"
|
|
218
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
219
|
-
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
220
|
-
Requires-Dist: httpx; extra == "all"
|
|
221
|
-
Requires-Dist: torchaudio; extra == "all"
|
|
222
226
|
Requires-Dist: html2text; extra == "all"
|
|
223
|
-
Requires-Dist:
|
|
227
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
228
|
+
Requires-Dist: filetype; extra == "all"
|
|
229
|
+
Requires-Dist: faker; extra == "all"
|
|
230
|
+
Requires-Dist: tabulate; extra == "all"
|
|
231
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
224
232
|
Requires-Dist: distributed; extra == "all"
|
|
225
|
-
Requires-Dist: peft; extra == "all"
|
|
226
|
-
Requires-Dist: setuptools; extra == "all"
|
|
227
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
228
|
-
Requires-Dist: google-auth; extra == "all"
|
|
229
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
230
|
-
Requires-Dist: beanie[odm]; extra == "all"
|
|
231
|
-
Requires-Dist: pyyaml; extra == "all"
|
|
232
|
-
Requires-Dist: dask[bag]; extra == "all"
|
|
233
233
|
Dynamic: author
|
|
234
234
|
Dynamic: author-email
|
|
235
235
|
Dynamic: description
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import inspect
|
|
1
2
|
from functools import cached_property
|
|
2
3
|
from typing import ClassVar, List, Any, Dict
|
|
3
4
|
|
|
@@ -9,7 +10,7 @@ from pydantic_core import PydanticUndefined, PydanticUndefinedType
|
|
|
9
10
|
from fmtr.tools.datatype_tools import is_optional
|
|
10
11
|
from fmtr.tools.iterator_tools import get_class_lookup
|
|
11
12
|
from fmtr.tools.string_tools import camel_to_snake
|
|
12
|
-
from fmtr.tools.tools import Auto, Required
|
|
13
|
+
from fmtr.tools.tools import Auto, Required, Empty
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class Field(FieldInfo):
|
|
@@ -19,28 +20,41 @@ class Field(FieldInfo):
|
|
|
19
20
|
|
|
20
21
|
"""
|
|
21
22
|
NAME = Auto
|
|
22
|
-
ANNOTATION =
|
|
23
|
+
ANNOTATION = Empty
|
|
24
|
+
EXCLUDE = False
|
|
23
25
|
DEFAULT = Auto
|
|
24
26
|
FILLS = None
|
|
25
27
|
DESCRIPTION = None
|
|
26
28
|
TITLE = Auto
|
|
27
29
|
CONFIG = None
|
|
28
30
|
|
|
29
|
-
def __init__(self):
|
|
31
|
+
def __init__(self, annotation=Empty, default=Empty, description=None, title=None, fills=None, exclude=None, **kwargs):
|
|
30
32
|
"""
|
|
31
33
|
|
|
32
34
|
Infer default from type annotation, if enabled, use class/argument fills to create titles/descriptions, etc.
|
|
33
35
|
|
|
34
36
|
"""
|
|
35
|
-
title = self.get_title_auto()
|
|
36
|
-
description = self.get_desc()
|
|
37
|
-
default = self.get_default_auto()
|
|
38
|
-
kwargs = self.CONFIG or {}
|
|
39
37
|
|
|
38
|
+
fills_super = getattr(super(), 'FILLS', None)
|
|
39
|
+
self.fills = (fills_super or {}) | (self.FILLS or {}) | (fills or {})
|
|
40
|
+
|
|
41
|
+
exclude = exclude if exclude is not None else self.EXCLUDE
|
|
42
|
+
|
|
43
|
+
self.annotation = self.ANNOTATION if annotation is Empty else annotation
|
|
44
|
+
if self.annotation is Empty:
|
|
45
|
+
raise ValueError("Annotation must be specified.")
|
|
46
|
+
annotation = self.annotation
|
|
47
|
+
|
|
48
|
+
default = self.get_default_auto(default)
|
|
40
49
|
if default is Required:
|
|
41
50
|
default = PydanticUndefined
|
|
42
51
|
|
|
43
|
-
|
|
52
|
+
description = self.get_desc(description)
|
|
53
|
+
title = self.get_title_auto(title)
|
|
54
|
+
kwargs |= (self.CONFIG or {})
|
|
55
|
+
|
|
56
|
+
super().__init__(default=default, title=title, description=description, exclude=exclude, **kwargs)
|
|
57
|
+
self.annotation = annotation
|
|
44
58
|
|
|
45
59
|
@classmethod
|
|
46
60
|
def get_name_auto(cls) -> str:
|
|
@@ -63,46 +77,55 @@ class Field(FieldInfo):
|
|
|
63
77
|
Get fills with filled title merged in
|
|
64
78
|
|
|
65
79
|
"""
|
|
66
|
-
return (self.FILLS or {}) | dict(title=self.get_title_auto())
|
|
67
80
|
|
|
68
|
-
|
|
81
|
+
fills_super = getattr(super(), 'FILLS', None)
|
|
82
|
+
|
|
83
|
+
return (fills_super or {}) | (self.FILLS or {}) | dict(title=self.get_title_auto())
|
|
84
|
+
|
|
85
|
+
def get_default_auto(self, default) -> type[Any] | None | PydanticUndefinedType:
|
|
69
86
|
"""
|
|
70
87
|
|
|
71
88
|
Infer default, if not specified.
|
|
72
89
|
|
|
73
90
|
"""
|
|
91
|
+
|
|
92
|
+
if default is not Empty:
|
|
93
|
+
return default
|
|
94
|
+
|
|
74
95
|
if self.DEFAULT is not Auto:
|
|
75
96
|
return self.DEFAULT
|
|
76
97
|
|
|
77
|
-
if is_optional(self.
|
|
98
|
+
if is_optional(self.annotation):
|
|
78
99
|
return None
|
|
79
100
|
else:
|
|
80
101
|
return Required
|
|
81
102
|
|
|
82
|
-
def get_title_auto(self) -> str | None:
|
|
103
|
+
def get_title_auto(self, mask) -> str | None:
|
|
83
104
|
"""
|
|
84
105
|
|
|
85
106
|
Get title from classname/mask
|
|
86
107
|
|
|
87
108
|
"""
|
|
88
109
|
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
if not mask:
|
|
111
|
+
mask = self.__class__.__name__ if self.TITLE is Auto else self.TITLE
|
|
91
112
|
|
|
92
113
|
if mask:
|
|
93
|
-
return mask.format(**fills)
|
|
114
|
+
return mask.format(**self.fills)
|
|
94
115
|
|
|
95
116
|
return None
|
|
96
117
|
|
|
97
|
-
def get_desc(self) -> str | None:
|
|
118
|
+
def get_desc(self, mask) -> str | None:
|
|
98
119
|
"""
|
|
99
120
|
|
|
100
|
-
|
|
121
|
+
Fill description mask, if specified
|
|
101
122
|
|
|
102
123
|
"""
|
|
103
124
|
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
mask = mask or self.DESCRIPTION
|
|
126
|
+
|
|
127
|
+
if mask:
|
|
128
|
+
return mask.format(**self.fills)
|
|
106
129
|
|
|
107
130
|
return None
|
|
108
131
|
|
|
@@ -189,15 +212,15 @@ class Base(BaseModel, MixinFromJson):
|
|
|
189
212
|
|
|
190
213
|
cls.FIELDS = fields
|
|
191
214
|
|
|
192
|
-
for name,
|
|
215
|
+
for name, field in fields.items():
|
|
193
216
|
if name in cls.__annotations__:
|
|
194
217
|
continue
|
|
195
218
|
|
|
196
|
-
|
|
197
|
-
|
|
219
|
+
if inspect.isclass(field):
|
|
220
|
+
field = field()
|
|
198
221
|
|
|
199
|
-
|
|
200
|
-
cls.__annotations__[name] = annotation
|
|
222
|
+
setattr(cls, name, field)
|
|
223
|
+
cls.__annotations__[name] = field.annotation
|
|
201
224
|
|
|
202
225
|
def to_df(self, name_value='value'):
|
|
203
226
|
"""
|
|
@@ -93,6 +93,9 @@ def is_optional(annotation) -> bool:
|
|
|
93
93
|
Is type/annotation optional? todo should be in typing_tools?
|
|
94
94
|
|
|
95
95
|
"""
|
|
96
|
+
if annotation is None:
|
|
97
|
+
return True
|
|
98
|
+
|
|
96
99
|
origin = get_origin(annotation)
|
|
97
100
|
args = get_args(annotation)
|
|
98
101
|
is_opt = origin is UnionType and NoneType in args
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.68
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.68
|
|
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:
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist:
|
|
171
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
172
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
173
|
+
Requires-Dist: appdirs; extra == "all"
|
|
174
|
+
Requires-Dist: python-on-whales; extra == "all"
|
|
175
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
176
|
+
Requires-Dist: motor; extra == "all"
|
|
177
|
+
Requires-Dist: pycountry; extra == "all"
|
|
178
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
179
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
180
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
181
|
+
Requires-Dist: json_repair; extra == "all"
|
|
182
|
+
Requires-Dist: httpx; extra == "all"
|
|
183
|
+
Requires-Dist: google-auth; extra == "all"
|
|
184
|
+
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
185
|
+
Requires-Dist: beanie[odm]; extra == "all"
|
|
186
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
176
187
|
Requires-Dist: playwright; extra == "all"
|
|
177
188
|
Requires-Dist: flet-video; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
189
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
190
|
+
Requires-Dist: semver; extra == "all"
|
|
181
191
|
Requires-Dist: pandas; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist: regex; extra == "all"
|
|
184
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
185
|
-
Requires-Dist: yamlscript; extra == "all"
|
|
186
|
-
Requires-Dist: Unidecode; extra == "all"
|
|
187
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
188
|
-
Requires-Dist: google-api-python-client; extra == "all"
|
|
189
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
192
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
190
193
|
Requires-Dist: tinynetrc; extra == "all"
|
|
194
|
+
Requires-Dist: cachetools; extra == "all"
|
|
195
|
+
Requires-Dist: logfire; extra == "all"
|
|
196
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
197
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
198
|
+
Requires-Dist: setuptools; extra == "all"
|
|
191
199
|
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
192
|
-
Requires-Dist:
|
|
193
|
-
Requires-Dist:
|
|
194
|
-
Requires-Dist:
|
|
195
|
-
Requires-Dist:
|
|
200
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
201
|
+
Requires-Dist: peft; extra == "all"
|
|
202
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
203
|
+
Requires-Dist: bokeh; extra == "all"
|
|
204
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
205
|
+
Requires-Dist: odfpy; extra == "all"
|
|
206
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
207
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
208
|
+
Requires-Dist: ollama; extra == "all"
|
|
209
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
196
210
|
Requires-Dist: diskcache; extra == "all"
|
|
197
|
-
Requires-Dist:
|
|
211
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
212
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
198
213
|
Requires-Dist: deepdiff; extra == "all"
|
|
199
|
-
Requires-Dist:
|
|
200
|
-
Requires-Dist:
|
|
201
|
-
Requires-Dist:
|
|
202
|
-
Requires-Dist: faker; extra == "all"
|
|
203
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
204
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
214
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
215
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
216
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
205
217
|
Requires-Dist: sre_yield; extra == "all"
|
|
206
|
-
Requires-Dist:
|
|
207
|
-
Requires-Dist: tabulate; extra == "all"
|
|
208
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
218
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
209
219
|
Requires-Dist: fastapi; extra == "all"
|
|
210
|
-
Requires-Dist:
|
|
211
|
-
Requires-Dist:
|
|
212
|
-
Requires-Dist:
|
|
213
|
-
Requires-Dist:
|
|
214
|
-
Requires-Dist:
|
|
215
|
-
Requires-Dist: appdirs; extra == "all"
|
|
216
|
-
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
220
|
+
Requires-Dist: regex; extra == "all"
|
|
221
|
+
Requires-Dist: openai; extra == "all"
|
|
222
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
223
|
+
Requires-Dist: torchvision; extra == "all"
|
|
224
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
217
225
|
Requires-Dist: pydantic; extra == "all"
|
|
218
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
219
|
-
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
220
|
-
Requires-Dist: httpx; extra == "all"
|
|
221
|
-
Requires-Dist: torchaudio; extra == "all"
|
|
222
226
|
Requires-Dist: html2text; extra == "all"
|
|
223
|
-
Requires-Dist:
|
|
227
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
228
|
+
Requires-Dist: filetype; extra == "all"
|
|
229
|
+
Requires-Dist: faker; extra == "all"
|
|
230
|
+
Requires-Dist: tabulate; extra == "all"
|
|
231
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
224
232
|
Requires-Dist: distributed; extra == "all"
|
|
225
|
-
Requires-Dist: peft; extra == "all"
|
|
226
|
-
Requires-Dist: setuptools; extra == "all"
|
|
227
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
228
|
-
Requires-Dist: google-auth; extra == "all"
|
|
229
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
230
|
-
Requires-Dist: beanie[odm]; extra == "all"
|
|
231
|
-
Requires-Dist: pyyaml; extra == "all"
|
|
232
|
-
Requires-Dist: dask[bag]; extra == "all"
|
|
233
233
|
Dynamic: author
|
|
234
234
|
Dynamic: author-email
|
|
235
235
|
Dynamic: description
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.66
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -18,68 +18,68 @@ pydantic-ai[logfire,openai]
|
|
|
18
18
|
ollama
|
|
19
19
|
|
|
20
20
|
[all]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
flet-webview
|
|
22
|
+
sentence_transformers
|
|
23
|
+
appdirs
|
|
24
|
+
python-on-whales
|
|
25
|
+
dnspython[doh]
|
|
26
|
+
motor
|
|
27
|
+
pycountry
|
|
28
|
+
pyyaml
|
|
29
|
+
tokenizers
|
|
30
|
+
logfire[fastapi]
|
|
31
|
+
json_repair
|
|
32
|
+
httpx
|
|
33
|
+
google-auth
|
|
34
|
+
pydantic-extra-types
|
|
35
|
+
beanie[odm]
|
|
36
|
+
Unidecode
|
|
26
37
|
playwright
|
|
27
38
|
flet-video
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
flet-webview
|
|
39
|
+
pytest-cov
|
|
40
|
+
semver
|
|
31
41
|
pandas
|
|
32
|
-
|
|
33
|
-
regex
|
|
34
|
-
google-auth-httplib2
|
|
35
|
-
yamlscript
|
|
36
|
-
Unidecode
|
|
37
|
-
dnspython[doh]
|
|
38
|
-
google-api-python-client
|
|
39
|
-
contexttimer
|
|
42
|
+
dask[bag]
|
|
40
43
|
tinynetrc
|
|
44
|
+
cachetools
|
|
45
|
+
logfire
|
|
46
|
+
google-auth-oauthlib
|
|
47
|
+
pydantic-settings
|
|
48
|
+
setuptools
|
|
41
49
|
transformers[sentencepiece]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
pydevd-pycharm~=251.25410.159
|
|
51
|
+
peft
|
|
52
|
+
pymupdf4llm
|
|
53
|
+
bokeh
|
|
54
|
+
openpyxl
|
|
55
|
+
odfpy
|
|
56
|
+
google-auth-httplib2
|
|
57
|
+
huggingface_hub
|
|
58
|
+
ollama
|
|
59
|
+
google-api-python-client
|
|
46
60
|
diskcache
|
|
47
|
-
|
|
61
|
+
pymupdf
|
|
62
|
+
flet[all]
|
|
48
63
|
deepdiff
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
faker
|
|
53
|
-
pytest-cov
|
|
54
|
-
pydantic-settings
|
|
64
|
+
deepmerge
|
|
65
|
+
logfire[httpx]
|
|
66
|
+
contexttimer
|
|
55
67
|
sre_yield
|
|
56
|
-
|
|
57
|
-
tabulate
|
|
58
|
-
pymupdf
|
|
68
|
+
uvicorn[standard]
|
|
59
69
|
fastapi
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
appdirs
|
|
66
|
-
logfire[fastapi]
|
|
70
|
+
regex
|
|
71
|
+
openai
|
|
72
|
+
httpx_retries
|
|
73
|
+
torchvision
|
|
74
|
+
yamlscript
|
|
67
75
|
pydantic
|
|
68
|
-
google-auth-oauthlib
|
|
69
|
-
pydantic-extra-types
|
|
70
|
-
httpx
|
|
71
|
-
torchaudio
|
|
72
76
|
html2text
|
|
73
|
-
|
|
77
|
+
torchaudio
|
|
78
|
+
filetype
|
|
79
|
+
faker
|
|
80
|
+
tabulate
|
|
81
|
+
pydantic-ai[logfire,openai]
|
|
74
82
|
distributed
|
|
75
|
-
peft
|
|
76
|
-
setuptools
|
|
77
|
-
huggingface_hub
|
|
78
|
-
google-auth
|
|
79
|
-
openpyxl
|
|
80
|
-
beanie[odm]
|
|
81
|
-
pyyaml
|
|
82
|
-
dask[bag]
|
|
83
83
|
|
|
84
84
|
[api]
|
|
85
85
|
fastapi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|