fmtr.tools 1.3.29__tar.gz → 1.3.31__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.29 → fmtr_tools-1.3.31}/PKG-INFO +44 -44
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/ai_tools/agentic_tools.py +18 -1
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/constants.py +3 -1
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/interface_tools/__init__.py +2 -2
- fmtr_tools-1.3.31/fmtr/tools/interface_tools/controls.py +13 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/interface_tools/interface_tools.py +44 -7
- fmtr_tools-1.3.31/fmtr/tools/version +1 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/PKG-INFO +44 -44
- fmtr_tools-1.3.29/fmtr/tools/interface_tools/controls.py +0 -137
- fmtr_tools-1.3.29/fmtr/tools/version +0 -1
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/LICENSE +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/README.md +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/ai_tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/ai_tools/inference_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/api_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/async_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/caching_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/context_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/data_modelling_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/datatype_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/debugging_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dns_tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dns_tools/client.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dns_tools/dm.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dns_tools/proxy.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/dns_tools/server.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/docker_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/cache_hfh.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/ep_test.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/install_yamlscript.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/remote_debug_test.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/entrypoints/shell_debug.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/environment_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/function_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/hash_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/html_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/http_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/import_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/inherit_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/iterator_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/json_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/logging_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/merging_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/metric_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/name_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/openai_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/packaging_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/path_tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/path_tools/app_path_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/path_tools/path_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/path_tools/type_path_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/pattern_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/pdf_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/platform_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/process_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/random_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/settings_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/setup_tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/setup_tools/setup_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/string_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tabular_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/version_tools/__init__.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/version_tools/version_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/requires.txt +43 -43
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/pyproject.toml +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/setup.cfg +0 -0
- {fmtr_tools-1.3.29 → fmtr_tools-1.3.31}/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.31
|
|
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
|
|
@@ -126,61 +126,61 @@ Requires-Dist: logfire[httpx]; extra == "http"
|
|
|
126
126
|
Provides-Extra: setup
|
|
127
127
|
Requires-Dist: setuptools; extra == "setup"
|
|
128
128
|
Provides-Extra: all
|
|
129
|
-
Requires-Dist:
|
|
130
|
-
Requires-Dist:
|
|
131
|
-
Requires-Dist:
|
|
132
|
-
Requires-Dist:
|
|
133
|
-
Requires-Dist:
|
|
134
|
-
Requires-Dist: google-auth; extra == "all"
|
|
135
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
136
|
-
Requires-Dist: semver; extra == "all"
|
|
137
|
-
Requires-Dist: openai; extra == "all"
|
|
129
|
+
Requires-Dist: fastapi; extra == "all"
|
|
130
|
+
Requires-Dist: torchvision; extra == "all"
|
|
131
|
+
Requires-Dist: docker; extra == "all"
|
|
132
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
133
|
+
Requires-Dist: bokeh; extra == "all"
|
|
138
134
|
Requires-Dist: distributed; extra == "all"
|
|
139
|
-
Requires-Dist:
|
|
135
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
136
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
137
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
138
|
+
Requires-Dist: google-auth; extra == "all"
|
|
140
139
|
Requires-Dist: dask[bag]; extra == "all"
|
|
141
|
-
Requires-Dist:
|
|
142
|
-
Requires-Dist: tabulate; extra == "all"
|
|
143
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
140
|
+
Requires-Dist: appdirs; extra == "all"
|
|
144
141
|
Requires-Dist: flet-video; extra == "all"
|
|
145
|
-
Requires-Dist:
|
|
146
|
-
Requires-Dist:
|
|
147
|
-
Requires-Dist:
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
142
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
143
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
144
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
145
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
146
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
150
147
|
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
151
|
-
Requires-Dist:
|
|
152
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
153
|
-
Requires-Dist: docker; extra == "all"
|
|
154
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
155
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
156
|
-
Requires-Dist: torchvision; extra == "all"
|
|
148
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
157
149
|
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
158
150
|
Requires-Dist: faker; extra == "all"
|
|
159
151
|
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
160
|
-
Requires-Dist: setuptools; extra == "all"
|
|
161
|
-
Requires-Dist: bokeh; extra == "all"
|
|
162
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
163
|
-
Requires-Dist: fastapi; extra == "all"
|
|
164
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
165
|
-
Requires-Dist: diskcache; extra == "all"
|
|
166
|
-
Requires-Dist: cachetools; extra == "all"
|
|
167
|
-
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
168
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
169
|
-
Requires-Dist: appdirs; extra == "all"
|
|
170
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
171
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
172
|
-
Requires-Dist: sre_yield; extra == "all"
|
|
173
152
|
Requires-Dist: flet[all]; extra == "all"
|
|
174
|
-
Requires-Dist:
|
|
153
|
+
Requires-Dist: semver; extra == "all"
|
|
154
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
175
155
|
Requires-Dist: google-api-python-client; extra == "all"
|
|
156
|
+
Requires-Dist: pandas; extra == "all"
|
|
157
|
+
Requires-Dist: openai; extra == "all"
|
|
158
|
+
Requires-Dist: logfire; extra == "all"
|
|
159
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
160
|
+
Requires-Dist: regex; extra == "all"
|
|
161
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
162
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
163
|
+
Requires-Dist: setuptools; extra == "all"
|
|
164
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
165
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
166
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
176
167
|
Requires-Dist: pydantic; extra == "all"
|
|
177
|
-
Requires-Dist:
|
|
168
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
169
|
+
Requires-Dist: html2text; extra == "all"
|
|
170
|
+
Requires-Dist: ollama; extra == "all"
|
|
171
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
172
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
173
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
174
|
+
Requires-Dist: filetype; extra == "all"
|
|
175
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
176
|
+
Requires-Dist: cachetools; extra == "all"
|
|
177
|
+
Requires-Dist: tabulate; extra == "all"
|
|
178
178
|
Requires-Dist: peft; extra == "all"
|
|
179
|
-
Requires-Dist:
|
|
179
|
+
Requires-Dist: diskcache; extra == "all"
|
|
180
180
|
Requires-Dist: httpx; extra == "all"
|
|
181
|
-
Requires-Dist:
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
181
|
+
Requires-Dist: json_repair; extra == "all"
|
|
182
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
183
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
from typing import List, Optional, Any, Annotated
|
|
2
|
+
|
|
1
3
|
import pydantic_ai
|
|
4
|
+
from pydantic import PlainValidator
|
|
2
5
|
from pydantic_ai import RunContext, ModelRetry
|
|
3
6
|
from pydantic_ai.agent import AgentRunResult, Agent
|
|
4
7
|
from pydantic_ai.models.openai import OpenAIModel
|
|
5
8
|
from pydantic_ai.providers.openai import OpenAIProvider
|
|
6
|
-
from typing import List, Optional, Any
|
|
7
9
|
|
|
8
10
|
from fmtr.tools import environment_tools as env
|
|
9
11
|
from fmtr.tools.constants import Constants
|
|
@@ -131,6 +133,21 @@ class Task:
|
|
|
131
133
|
"""
|
|
132
134
|
return f'{self.__class__.__name__}({repr(truncate_mid(self.SYSTEM_PROMPT_STATIC, 100))})'
|
|
133
135
|
|
|
136
|
+
|
|
137
|
+
def default_prompt_none_specified(text):
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
If the prompt is falsey, explicitly state None Specified
|
|
141
|
+
|
|
142
|
+
"""
|
|
143
|
+
if not (text or '').strip():
|
|
144
|
+
return Constants.PROMPT_NONE_SPECIFIED
|
|
145
|
+
return text
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
StringDefaultNoneSpecified = Annotated[str, PlainValidator(default_prompt_none_specified)]
|
|
149
|
+
|
|
150
|
+
|
|
134
151
|
if __name__ == '__main__':
|
|
135
152
|
import asyncio
|
|
136
153
|
from fmtr.tools import dm
|
|
@@ -32,6 +32,8 @@ class Constants:
|
|
|
32
32
|
FMTR_AI_HOST_KEY = 'FMTR_URL_HOST'
|
|
33
33
|
FMTR_AI_HOST_DEFAULT = 'ai.gex.fmtr.dev'
|
|
34
34
|
|
|
35
|
+
FMTR_DEV_INTERFACE_URL = 'https://ws.gex.fmtr.dev/'
|
|
36
|
+
|
|
35
37
|
FILENAME_CONFIG = 'settings.yaml'
|
|
36
38
|
DIR_NAME_REPO = 'repo'
|
|
37
39
|
DIR_NAME_DATA = 'data'
|
|
@@ -50,4 +52,4 @@ class Constants:
|
|
|
50
52
|
|
|
51
53
|
INFRA = 'infra'
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
PROMPT_NONE_SPECIFIED = '[None Specified]'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
2
2
|
|
|
3
3
|
try:
|
|
4
|
-
from fmtr.tools.interface_tools.interface_tools import Interface, update
|
|
4
|
+
from fmtr.tools.interface_tools.interface_tools import Interface, update, progress
|
|
5
5
|
from fmtr.tools.interface_tools import controls
|
|
6
6
|
except ImportError as exception:
|
|
7
|
-
Interface = update = controls = MissingExtraMockModule('interface', exception)
|
|
7
|
+
Interface = update = progress = controls = MissingExtraMockModule('interface', exception)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import flet as ft
|
|
2
|
+
|
|
3
|
+
class SliderSteps(ft.Slider):
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
Slider control using step instead of divisions
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
def __init__(self, *args, min=10, max=100, step=10, **kwargs):
|
|
11
|
+
self.step = step
|
|
12
|
+
divisions = (max - min) // step
|
|
13
|
+
super().__init__(*args, min=min, max=max, divisions=divisions, **kwargs)
|
|
@@ -2,21 +2,58 @@ import flet as ft
|
|
|
2
2
|
from flet.core.types import AppView
|
|
3
3
|
from flet.core.view import View
|
|
4
4
|
|
|
5
|
+
from fmtr.tools import environment_tools
|
|
6
|
+
from fmtr.tools.constants import Constants
|
|
7
|
+
from fmtr.tools.function_tools import BoundDecorator
|
|
5
8
|
from fmtr.tools.logging_tools import logger
|
|
6
9
|
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
class update(BoundDecorator):
|
|
9
12
|
"""
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Update the page after the decorated function is called.
|
|
12
15
|
|
|
13
16
|
"""
|
|
14
17
|
|
|
15
|
-
def
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
def stop(self, instance):
|
|
19
|
+
instance.page.update()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class progress(update):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
Run the function while a progress indicator (e.g. spinner) is and within the object-defined context (e.g. logging span).
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def get_context(self, instance):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
Use instance-defined context.
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
return instance.context
|
|
36
|
+
|
|
37
|
+
def start(self, instance):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
Make progress visible and update.
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
instance.progress.visible = True
|
|
44
|
+
instance.page.update()
|
|
45
|
+
|
|
46
|
+
def stop(self, instance):
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
Make progress not visible and update.
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
instance.progress.visible = False
|
|
53
|
+
super().stop(instance)
|
|
54
|
+
|
|
55
|
+
|
|
18
56
|
|
|
19
|
-
return wrapped
|
|
20
57
|
|
|
21
58
|
class Interface(ft.Column):
|
|
22
59
|
"""
|
|
@@ -27,7 +64,7 @@ class Interface(ft.Column):
|
|
|
27
64
|
TITLE = 'Base Interface'
|
|
28
65
|
HOST = '0.0.0.0'
|
|
29
66
|
PORT = 8080
|
|
30
|
-
URL = None
|
|
67
|
+
URL = Constants.FMTR_DEV_INTERFACE_URL if environment_tools.IS_DEV else None
|
|
31
68
|
APPVIEW = AppView.WEB_BROWSER
|
|
32
69
|
PATH_ASSETS = None
|
|
33
70
|
ROUTE_ROOT = '/'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.31
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.31
|
|
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
|
|
@@ -126,61 +126,61 @@ Requires-Dist: logfire[httpx]; extra == "http"
|
|
|
126
126
|
Provides-Extra: setup
|
|
127
127
|
Requires-Dist: setuptools; extra == "setup"
|
|
128
128
|
Provides-Extra: all
|
|
129
|
-
Requires-Dist:
|
|
130
|
-
Requires-Dist:
|
|
131
|
-
Requires-Dist:
|
|
132
|
-
Requires-Dist:
|
|
133
|
-
Requires-Dist:
|
|
134
|
-
Requires-Dist: google-auth; extra == "all"
|
|
135
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
136
|
-
Requires-Dist: semver; extra == "all"
|
|
137
|
-
Requires-Dist: openai; extra == "all"
|
|
129
|
+
Requires-Dist: fastapi; extra == "all"
|
|
130
|
+
Requires-Dist: torchvision; extra == "all"
|
|
131
|
+
Requires-Dist: docker; extra == "all"
|
|
132
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
133
|
+
Requires-Dist: bokeh; extra == "all"
|
|
138
134
|
Requires-Dist: distributed; extra == "all"
|
|
139
|
-
Requires-Dist:
|
|
135
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
136
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
137
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
138
|
+
Requires-Dist: google-auth; extra == "all"
|
|
140
139
|
Requires-Dist: dask[bag]; extra == "all"
|
|
141
|
-
Requires-Dist:
|
|
142
|
-
Requires-Dist: tabulate; extra == "all"
|
|
143
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
140
|
+
Requires-Dist: appdirs; extra == "all"
|
|
144
141
|
Requires-Dist: flet-video; extra == "all"
|
|
145
|
-
Requires-Dist:
|
|
146
|
-
Requires-Dist:
|
|
147
|
-
Requires-Dist:
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
142
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
143
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
144
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
145
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
146
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
150
147
|
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
151
|
-
Requires-Dist:
|
|
152
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
153
|
-
Requires-Dist: docker; extra == "all"
|
|
154
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
155
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
156
|
-
Requires-Dist: torchvision; extra == "all"
|
|
148
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
157
149
|
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
158
150
|
Requires-Dist: faker; extra == "all"
|
|
159
151
|
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
160
|
-
Requires-Dist: setuptools; extra == "all"
|
|
161
|
-
Requires-Dist: bokeh; extra == "all"
|
|
162
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
163
|
-
Requires-Dist: fastapi; extra == "all"
|
|
164
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
165
|
-
Requires-Dist: diskcache; extra == "all"
|
|
166
|
-
Requires-Dist: cachetools; extra == "all"
|
|
167
|
-
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
168
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
169
|
-
Requires-Dist: appdirs; extra == "all"
|
|
170
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
171
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
172
|
-
Requires-Dist: sre_yield; extra == "all"
|
|
173
152
|
Requires-Dist: flet[all]; extra == "all"
|
|
174
|
-
Requires-Dist:
|
|
153
|
+
Requires-Dist: semver; extra == "all"
|
|
154
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
175
155
|
Requires-Dist: google-api-python-client; extra == "all"
|
|
156
|
+
Requires-Dist: pandas; extra == "all"
|
|
157
|
+
Requires-Dist: openai; extra == "all"
|
|
158
|
+
Requires-Dist: logfire; extra == "all"
|
|
159
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
160
|
+
Requires-Dist: regex; extra == "all"
|
|
161
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
162
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
163
|
+
Requires-Dist: setuptools; extra == "all"
|
|
164
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
165
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
166
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
176
167
|
Requires-Dist: pydantic; extra == "all"
|
|
177
|
-
Requires-Dist:
|
|
168
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
169
|
+
Requires-Dist: html2text; extra == "all"
|
|
170
|
+
Requires-Dist: ollama; extra == "all"
|
|
171
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
172
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
173
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
174
|
+
Requires-Dist: filetype; extra == "all"
|
|
175
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
176
|
+
Requires-Dist: cachetools; extra == "all"
|
|
177
|
+
Requires-Dist: tabulate; extra == "all"
|
|
178
178
|
Requires-Dist: peft; extra == "all"
|
|
179
|
-
Requires-Dist:
|
|
179
|
+
Requires-Dist: diskcache; extra == "all"
|
|
180
180
|
Requires-Dist: httpx; extra == "all"
|
|
181
|
-
Requires-Dist:
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
181
|
+
Requires-Dist: json_repair; extra == "all"
|
|
182
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
183
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import inspect
|
|
2
|
-
|
|
3
|
-
import flet as ft
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ContextBase:
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
A mixin base that can be used as both a synchronous and asynchronous context manager,
|
|
10
|
-
or as a decorator to wrap synchronous or asynchronous functions.
|
|
11
|
-
The control becomes visible when entering the context or invoking the wrapped function,
|
|
12
|
-
and is hidden again when exiting.
|
|
13
|
-
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
def start(self):
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
Show the control and update the page.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
self.visible = True
|
|
23
|
-
self.page.update()
|
|
24
|
-
|
|
25
|
-
def stop(self):
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
Hide the control and update the page.
|
|
29
|
-
|
|
30
|
-
"""
|
|
31
|
-
self.visible = False
|
|
32
|
-
self.page.update()
|
|
33
|
-
|
|
34
|
-
def context(self, func):
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
Decorator that wraps a synchronous or asynchronous function.
|
|
38
|
-
While the function runs, the control is visible.
|
|
39
|
-
|
|
40
|
-
"""
|
|
41
|
-
if inspect.iscoroutinefunction(func):
|
|
42
|
-
async def async_wrapped(*args, **kwargs):
|
|
43
|
-
async with self:
|
|
44
|
-
return await func(*args, **kwargs)
|
|
45
|
-
|
|
46
|
-
return async_wrapped
|
|
47
|
-
else:
|
|
48
|
-
def sync_wrapped(*args, **kwargs):
|
|
49
|
-
with self:
|
|
50
|
-
return func(*args, **kwargs)
|
|
51
|
-
|
|
52
|
-
return sync_wrapped
|
|
53
|
-
|
|
54
|
-
def __enter__(self):
|
|
55
|
-
"""
|
|
56
|
-
|
|
57
|
-
Enter the control context (sync).
|
|
58
|
-
|
|
59
|
-
"""
|
|
60
|
-
self.start()
|
|
61
|
-
return self
|
|
62
|
-
|
|
63
|
-
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
64
|
-
"""
|
|
65
|
-
|
|
66
|
-
Exit the control context (sync).
|
|
67
|
-
|
|
68
|
-
"""
|
|
69
|
-
self.stop()
|
|
70
|
-
|
|
71
|
-
async def __aenter__(self):
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
Enter the control context (async).
|
|
75
|
-
"""
|
|
76
|
-
|
|
77
|
-
result = self.start()
|
|
78
|
-
if inspect.isawaitable(result):
|
|
79
|
-
await result
|
|
80
|
-
return self
|
|
81
|
-
|
|
82
|
-
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
Exit the control context (async).
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
result = self.stop()
|
|
89
|
-
if inspect.isawaitable(result):
|
|
90
|
-
await result
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class ContextRing(ft.ProgressRing, ContextBase):
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
A progress ring as a context manager.
|
|
97
|
-
|
|
98
|
-
"""
|
|
99
|
-
|
|
100
|
-
def __init__(self, *args, **kwargs):
|
|
101
|
-
"""
|
|
102
|
-
|
|
103
|
-
Initialize the progress ring as hidden by default.
|
|
104
|
-
|
|
105
|
-
"""
|
|
106
|
-
super().__init__(*args, **kwargs, visible=False)
|
|
107
|
-
|
|
108
|
-
class ProgressButton(ft.Button):
|
|
109
|
-
"""
|
|
110
|
-
|
|
111
|
-
Button containing a progress ring.
|
|
112
|
-
|
|
113
|
-
"""
|
|
114
|
-
|
|
115
|
-
def __init__(self, *args, on_click=None, ring: ContextRing = None, **kwargs):
|
|
116
|
-
"""
|
|
117
|
-
|
|
118
|
-
Run on_click in run context manager
|
|
119
|
-
|
|
120
|
-
"""
|
|
121
|
-
self.ring = ring or ContextRing()
|
|
122
|
-
|
|
123
|
-
super().__init__(*args, content=self.ring, on_click=self.ring.context(on_click), **kwargs)
|
|
124
|
-
self.context = self.ring.context
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class SliderSteps(ft.Slider):
|
|
128
|
-
"""
|
|
129
|
-
|
|
130
|
-
Slider control using step instead of divisions
|
|
131
|
-
|
|
132
|
-
"""
|
|
133
|
-
|
|
134
|
-
def __init__(self, *args, min=10, max=100, step=10, **kwargs):
|
|
135
|
-
self.step = step
|
|
136
|
-
divisions = (max - min) // step
|
|
137
|
-
super().__init__(*args, min=min, max=max, divisions=divisions, **kwargs)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.29
|
|
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
|
|
@@ -14,61 +14,61 @@ pydantic-ai[logfire,openai]
|
|
|
14
14
|
ollama
|
|
15
15
|
|
|
16
16
|
[all]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
google-auth
|
|
23
|
-
pydantic-settings
|
|
24
|
-
semver
|
|
25
|
-
openai
|
|
17
|
+
fastapi
|
|
18
|
+
torchvision
|
|
19
|
+
docker
|
|
20
|
+
tokenizers
|
|
21
|
+
bokeh
|
|
26
22
|
distributed
|
|
27
|
-
|
|
23
|
+
contexttimer
|
|
24
|
+
logfire[fastapi]
|
|
25
|
+
openpyxl
|
|
26
|
+
google-auth
|
|
28
27
|
dask[bag]
|
|
29
|
-
|
|
30
|
-
tabulate
|
|
31
|
-
flet-webview
|
|
28
|
+
appdirs
|
|
32
29
|
flet-video
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
yamlscript
|
|
31
|
+
sre_yield
|
|
32
|
+
pytest-cov
|
|
33
|
+
deepmerge
|
|
34
|
+
Unidecode
|
|
38
35
|
pydantic-ai[logfire,openai]
|
|
39
|
-
|
|
40
|
-
google-auth-httplib2
|
|
41
|
-
docker
|
|
42
|
-
sentence_transformers
|
|
43
|
-
httpx_retries
|
|
44
|
-
torchvision
|
|
36
|
+
flet-webview
|
|
45
37
|
uvicorn[standard]
|
|
46
38
|
faker
|
|
47
39
|
transformers[sentencepiece]
|
|
48
|
-
setuptools
|
|
49
|
-
bokeh
|
|
50
|
-
contexttimer
|
|
51
|
-
fastapi
|
|
52
|
-
tokenizers
|
|
53
|
-
diskcache
|
|
54
|
-
cachetools
|
|
55
|
-
pydevd-pycharm~=251.25410.159
|
|
56
|
-
openpyxl
|
|
57
|
-
appdirs
|
|
58
|
-
huggingface_hub
|
|
59
|
-
pytest-cov
|
|
60
|
-
sre_yield
|
|
61
40
|
flet[all]
|
|
62
|
-
|
|
41
|
+
semver
|
|
42
|
+
sentence_transformers
|
|
63
43
|
google-api-python-client
|
|
44
|
+
pandas
|
|
45
|
+
openai
|
|
46
|
+
logfire
|
|
47
|
+
huggingface_hub
|
|
48
|
+
regex
|
|
49
|
+
pymupdf
|
|
50
|
+
google-auth-httplib2
|
|
51
|
+
setuptools
|
|
52
|
+
google-auth-oauthlib
|
|
53
|
+
pydantic-settings
|
|
54
|
+
pyyaml
|
|
64
55
|
pydantic
|
|
65
|
-
|
|
56
|
+
httpx_retries
|
|
57
|
+
html2text
|
|
58
|
+
ollama
|
|
59
|
+
dnspython[doh]
|
|
60
|
+
tinynetrc
|
|
61
|
+
pydevd-pycharm~=251.25410.159
|
|
62
|
+
filetype
|
|
63
|
+
logfire[httpx]
|
|
64
|
+
cachetools
|
|
65
|
+
tabulate
|
|
66
66
|
peft
|
|
67
|
-
|
|
67
|
+
diskcache
|
|
68
68
|
httpx
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
json_repair
|
|
70
|
+
torchaudio
|
|
71
|
+
pymupdf4llm
|
|
72
72
|
|
|
73
73
|
[api]
|
|
74
74
|
fastapi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|