fmtr.tools 1.1.11__py3-none-any.whl → 1.1.13__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/settings_tools.py +20 -3
- fmtr/tools/version +1 -1
- fmtr/tools/yaml_tools.py +15 -0
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/METADATA +38 -38
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/RECORD +9 -9
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/WHEEL +0 -0
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/entry_points.txt +0 -0
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/licenses/LICENSE +0 -0
- {fmtr_tools-1.1.11.dist-info → fmtr_tools-1.1.13.dist-info}/top_level.txt +0 -0
fmtr/tools/settings_tools.py
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
from pydantic_settings import BaseSettings, PydanticBaseSettingsSource, YamlConfigSettingsSource, EnvSettingsSource, CliSettingsSource
|
|
2
|
-
from typing import ClassVar
|
|
2
|
+
from typing import ClassVar, Any
|
|
3
3
|
|
|
4
|
-
from fmtr.tools.path_tools import PackagePaths
|
|
4
|
+
from fmtr.tools.path_tools import PackagePaths, Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class YamlScriptConfigSettingsSource(YamlConfigSettingsSource):
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
Customer source for reading YAML *Script* (as opposed to plain YAML) configuration files.
|
|
11
|
+
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def _read_file(self, file_path: Path) -> dict[str, Any]:
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
Use our own Path class to read YAML Script.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
data = Path(file_path).read_yaml() or {}
|
|
21
|
+
return data
|
|
5
22
|
|
|
6
23
|
|
|
7
24
|
class Base(BaseSettings):
|
|
@@ -34,7 +51,7 @@ class Base(BaseSettings):
|
|
|
34
51
|
init_settings,
|
|
35
52
|
CliSettingsSource(settings_cls, cli_parse_args=True),
|
|
36
53
|
EnvSettingsSource(settings_cls, env_prefix=cls.get_env_prefix()),
|
|
37
|
-
|
|
54
|
+
YamlScriptConfigSettingsSource(settings_cls, yaml_file=cls.paths.settings),
|
|
38
55
|
)
|
|
39
56
|
|
|
40
57
|
return sources
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.13
|
fmtr/tools/yaml_tools.py
CHANGED
|
@@ -5,6 +5,13 @@ from yaml import dump
|
|
|
5
5
|
|
|
6
6
|
from fmtr.tools import environment_tools as env
|
|
7
7
|
|
|
8
|
+
try:
|
|
9
|
+
import yamlscript
|
|
10
|
+
except ImportError:
|
|
11
|
+
raise # Raise if even the package isn't installed, to trigger the regular missing extra exception.
|
|
12
|
+
except Exception as exception:
|
|
13
|
+
pass # Allow missing binary, so we can install on-demand
|
|
14
|
+
|
|
8
15
|
|
|
9
16
|
def install():
|
|
10
17
|
"""
|
|
@@ -67,3 +74,11 @@ def from_yaml(yaml_str: str) -> Any:
|
|
|
67
74
|
"""
|
|
68
75
|
obj = get_interpreter().load(yaml_str)
|
|
69
76
|
return obj
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if __name__ == '__main__':
|
|
80
|
+
from fmtr.tools import Path
|
|
81
|
+
|
|
82
|
+
py = Path('hw.yml')
|
|
83
|
+
data = py.read_yaml()
|
|
84
|
+
data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.13
|
|
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
|
|
@@ -9,52 +9,52 @@ License: Copyright © 2025 Frontmatter. All rights reserved.
|
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Provides-Extra: test
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
15
|
-
Requires-Dist:
|
|
16
|
-
Requires-Dist:
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
12
|
+
Requires-Dist: json_repair; extra == "test"
|
|
13
|
+
Requires-Dist: openpyxl; extra == "test"
|
|
14
|
+
Requires-Dist: google-api-python-client; extra == "test"
|
|
15
|
+
Requires-Dist: yamlscript; extra == "test"
|
|
16
|
+
Requires-Dist: pymupdf; extra == "test"
|
|
17
|
+
Requires-Dist: tokenizers; extra == "test"
|
|
18
|
+
Requires-Dist: torchaudio; extra == "test"
|
|
19
|
+
Requires-Dist: faker; extra == "test"
|
|
20
|
+
Requires-Dist: huggingface_hub; extra == "test"
|
|
21
|
+
Requires-Dist: google-auth; extra == "test"
|
|
20
22
|
Requires-Dist: google-auth-oauthlib; extra == "test"
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: pydantic-settings; extra == "test"
|
|
24
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "test"
|
|
25
|
+
Requires-Dist: fastapi; extra == "test"
|
|
26
|
+
Requires-Dist: contexttimer; extra == "test"
|
|
23
27
|
Requires-Dist: transformers[sentencepiece]; extra == "test"
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: pydantic; extra == "test"
|
|
26
|
-
Requires-Dist: deepmerge; extra == "test"
|
|
27
|
-
Requires-Dist: pymupdf; extra == "test"
|
|
28
|
-
Requires-Dist: sentence_transformers; extra == "test"
|
|
29
|
-
Requires-Dist: html2text; extra == "test"
|
|
28
|
+
Requires-Dist: dask[bag]; extra == "test"
|
|
30
29
|
Requires-Dist: sre_yield; extra == "test"
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
30
|
+
Requires-Dist: pydevd-pycharm; extra == "test"
|
|
31
|
+
Requires-Dist: flet-webview; extra == "test"
|
|
32
|
+
Requires-Dist: deepmerge; extra == "test"
|
|
33
|
+
Requires-Dist: pandas; extra == "test"
|
|
34
|
+
Requires-Dist: pydantic; extra == "test"
|
|
35
|
+
Requires-Dist: openai; extra == "test"
|
|
36
|
+
Requires-Dist: pymupdf4llm; extra == "test"
|
|
34
37
|
Requires-Dist: appdirs; extra == "test"
|
|
35
|
-
Requires-Dist: google-api-python-client; extra == "test"
|
|
36
|
-
Requires-Dist: json_repair; extra == "test"
|
|
37
|
-
Requires-Dist: dask[bag]; extra == "test"
|
|
38
|
-
Requires-Dist: torchaudio; extra == "test"
|
|
39
|
-
Requires-Dist: google-auth; extra == "test"
|
|
40
|
-
Requires-Dist: tabulate; extra == "test"
|
|
41
|
-
Requires-Dist: tokenizers; extra == "test"
|
|
42
|
-
Requires-Dist: ollama; extra == "test"
|
|
43
38
|
Requires-Dist: torchvision; extra == "test"
|
|
44
|
-
Requires-Dist:
|
|
45
|
-
Requires-Dist: faker; extra == "test"
|
|
46
|
-
Requires-Dist: bokeh; extra == "test"
|
|
47
|
-
Requires-Dist: docker; extra == "test"
|
|
39
|
+
Requires-Dist: logfire; extra == "test"
|
|
48
40
|
Requires-Dist: tinynetrc; extra == "test"
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
41
|
+
Requires-Dist: flet[all]; extra == "test"
|
|
42
|
+
Requires-Dist: html2text; extra == "test"
|
|
43
|
+
Requires-Dist: google-auth-httplib2; extra == "test"
|
|
44
|
+
Requires-Dist: docker; extra == "test"
|
|
45
|
+
Requires-Dist: Unidecode; extra == "test"
|
|
51
46
|
Requires-Dist: diskcache; extra == "test"
|
|
52
|
-
Requires-Dist:
|
|
47
|
+
Requires-Dist: uvicorn[standard]; extra == "test"
|
|
48
|
+
Requires-Dist: bokeh; extra == "test"
|
|
49
|
+
Requires-Dist: sentence_transformers; extra == "test"
|
|
50
|
+
Requires-Dist: tabulate; extra == "test"
|
|
51
|
+
Requires-Dist: ollama; extra == "test"
|
|
53
52
|
Requires-Dist: logfire[fastapi]; extra == "test"
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Requires-Dist: distributed; extra == "test"
|
|
53
|
+
Requires-Dist: peft; extra == "test"
|
|
56
54
|
Requires-Dist: flet-video; extra == "test"
|
|
57
|
-
Requires-Dist:
|
|
55
|
+
Requires-Dist: semver; extra == "test"
|
|
56
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
57
|
+
Requires-Dist: distributed; extra == "test"
|
|
58
58
|
Provides-Extra: yaml
|
|
59
59
|
Requires-Dist: yamlscript; extra == "yaml"
|
|
60
60
|
Provides-Extra: logging
|
|
@@ -36,16 +36,16 @@ fmtr/tools/process_tools.py,sha256=Ysh5Dk2QFBhXQerArjKdt7xZd3JrN5Ho02AaOjH0Nnw,1
|
|
|
36
36
|
fmtr/tools/profiling_tools.py,sha256=jpXVjaNKPydTasEQVNXvxzGtMhXPit08AnJddkU8uIc,46
|
|
37
37
|
fmtr/tools/random_tools.py,sha256=4VlQdk5THbR8ka4pZaLbk_ZO_4yy6PF_lHZes_rgenY,2223
|
|
38
38
|
fmtr/tools/semantic_tools.py,sha256=cxY9NSAHWj4nEc6Oj4qA1omR3dWbl2OuH7_PkINc6_E,1386
|
|
39
|
-
fmtr/tools/settings_tools.py,sha256=
|
|
39
|
+
fmtr/tools/settings_tools.py,sha256=o11W3T60UZSvCTkh_eEQq1Mx74GycQ6JxUr0plBDbsk,2356
|
|
40
40
|
fmtr/tools/spaces_tools.py,sha256=D_he3mve6DruB3OPS6QyzqD05ChHnRTb4buViKPe7To,1099
|
|
41
41
|
fmtr/tools/string_tools.py,sha256=Q2vv7kuGVMaQlNSUxJYhex6WUQHDus40ht0PGImPjNQ,3879
|
|
42
42
|
fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,120
|
|
43
43
|
fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
|
|
44
44
|
fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
|
|
45
45
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
46
|
-
fmtr/tools/version,sha256=
|
|
46
|
+
fmtr/tools/version,sha256=0MMPfOeY9Ul9U6Fl8ydzCGHg0ZKasYZSxI22Y6RNCU4,6
|
|
47
47
|
fmtr/tools/version_tools.py,sha256=yNs_CGqWpqE4jbK9wsPIi14peJVXYbhIcMqHAFOw3yE,1480
|
|
48
|
-
fmtr/tools/yaml_tools.py,sha256=
|
|
48
|
+
fmtr/tools/yaml_tools.py,sha256=9kuYChqJelWQIjGlSnK4iDdOWWH06P0gp9jIcRrC3UI,1903
|
|
49
49
|
fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
|
|
50
50
|
fmtr/tools/ai_tools/agentic_tools.py,sha256=YebH7R9ovVo3GzfWAZxY49e2fNt13APDMe290xx7zks,3720
|
|
51
51
|
fmtr/tools/ai_tools/inference_tools.py,sha256=yF8Oxph0L8W2CnK_o-MVztBhWVwBpgOEkx9_m3uqQww,11840
|
|
@@ -60,9 +60,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
|
|
|
60
60
|
fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
|
|
61
61
|
fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
|
|
62
62
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
63
|
-
fmtr_tools-1.1.
|
|
64
|
-
fmtr_tools-1.1.
|
|
65
|
-
fmtr_tools-1.1.
|
|
66
|
-
fmtr_tools-1.1.
|
|
67
|
-
fmtr_tools-1.1.
|
|
68
|
-
fmtr_tools-1.1.
|
|
63
|
+
fmtr_tools-1.1.13.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
64
|
+
fmtr_tools-1.1.13.dist-info/METADATA,sha256=gJz-5eKN163pQUqSNZIu--IH8WiOrNPRr7ZZrlEzC3s,14855
|
|
65
|
+
fmtr_tools-1.1.13.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
66
|
+
fmtr_tools-1.1.13.dist-info/entry_points.txt,sha256=e-eOW1Ml13tbxHC6Er1MnVOEDePeWw7DKwlE-l-gCY0,205
|
|
67
|
+
fmtr_tools-1.1.13.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
|
|
68
|
+
fmtr_tools-1.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|