fmtr.tools 1.3.16__tar.gz → 1.3.17__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.16 → fmtr_tools-1.3.17}/PKG-INFO +45 -45
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dns_tools/dm.py +3 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dns_tools/proxy.py +1 -1
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dns_tools/server.py +37 -39
- fmtr_tools-1.3.17/fmtr/tools/version +1 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/PKG-INFO +45 -45
- fmtr_tools-1.3.16/fmtr/tools/version +0 -1
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/LICENSE +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/README.md +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/ai_tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/ai_tools/agentic_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/ai_tools/inference_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/api_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/async_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/caching_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/constants.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/data_modelling_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/datatype_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/debugging_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dns_tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/dns_tools/client.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/docker_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/cache_hfh.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/ep_test.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/install_yamlscript.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/remote_debug_test.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/entrypoints/shell_debug.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/environment_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/function_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/hash_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/html_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/http_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/import_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/interface_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/iterator_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/json_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/logging_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/merging_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/metric_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/name_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/openai_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/packaging_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/path_tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/path_tools/app_path_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/path_tools/path_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/path_tools/type_path_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/pattern_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/pdf_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/platform_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/process_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/random_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/settings_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/setup_tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/setup_tools/setup_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/string_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tabular_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/version_tools/__init__.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/version_tools/version_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/requires.txt +44 -44
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/pyproject.toml +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/setup.cfg +0 -0
- {fmtr_tools-1.3.16 → fmtr_tools-1.3.17}/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.17
|
|
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: filetype; extra == "all"
|
|
130
|
-
Requires-Dist: pyyaml; extra == "all"
|
|
131
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
132
|
-
Requires-Dist: tinynetrc; extra == "all"
|
|
133
|
-
Requires-Dist: flet[all]; extra == "all"
|
|
134
|
-
Requires-Dist: tabulate; extra == "all"
|
|
135
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
136
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
137
|
-
Requires-Dist: docker; extra == "all"
|
|
138
129
|
Requires-Dist: Unidecode; extra == "all"
|
|
139
|
-
Requires-Dist:
|
|
140
|
-
Requires-Dist:
|
|
141
|
-
Requires-Dist: deepmerge; extra == "all"
|
|
142
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
143
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
144
|
-
Requires-Dist: torchaudio; extra == "all"
|
|
145
|
-
Requires-Dist: logfire; extra == "all"
|
|
146
|
-
Requires-Dist: diskcache; extra == "all"
|
|
147
|
-
Requires-Dist: cachetools; extra == "all"
|
|
130
|
+
Requires-Dist: semver; extra == "all"
|
|
131
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
148
132
|
Requires-Dist: setuptools; extra == "all"
|
|
149
|
-
Requires-Dist:
|
|
150
|
-
Requires-Dist:
|
|
133
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
134
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
135
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
136
|
+
Requires-Dist: docker; extra == "all"
|
|
137
|
+
Requires-Dist: bokeh; extra == "all"
|
|
138
|
+
Requires-Dist: filetype; extra == "all"
|
|
139
|
+
Requires-Dist: torchvision; extra == "all"
|
|
151
140
|
Requires-Dist: faker; extra == "all"
|
|
152
|
-
Requires-Dist:
|
|
153
|
-
Requires-Dist: google-auth; extra == "all"
|
|
141
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
154
142
|
Requires-Dist: fastapi; extra == "all"
|
|
155
|
-
Requires-Dist: peft; extra == "all"
|
|
156
|
-
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
157
|
-
Requires-Dist: yamlscript; extra == "all"
|
|
158
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
159
|
-
Requires-Dist: torchvision; extra == "all"
|
|
160
|
-
Requires-Dist: appdirs; extra == "all"
|
|
161
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
162
|
-
Requires-Dist: logfire[httpx]; extra == "all"
|
|
163
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
164
143
|
Requires-Dist: regex; extra == "all"
|
|
165
|
-
Requires-Dist: pydantic; extra == "all"
|
|
166
|
-
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
167
144
|
Requires-Dist: openai; extra == "all"
|
|
168
|
-
Requires-Dist:
|
|
169
|
-
Requires-Dist:
|
|
145
|
+
Requires-Dist: appdirs; extra == "all"
|
|
146
|
+
Requires-Dist: httpx; extra == "all"
|
|
147
|
+
Requires-Dist: distributed; extra == "all"
|
|
148
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
149
|
+
Requires-Dist: peft; extra == "all"
|
|
150
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
151
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
170
152
|
Requires-Dist: json_repair; extra == "all"
|
|
171
|
-
Requires-Dist:
|
|
153
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
154
|
+
Requires-Dist: cachetools; extra == "all"
|
|
155
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
156
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
172
157
|
Requires-Dist: html2text; extra == "all"
|
|
173
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
174
|
-
Requires-Dist: semver; extra == "all"
|
|
175
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
176
158
|
Requires-Dist: ollama; extra == "all"
|
|
159
|
+
Requires-Dist: pandas; extra == "all"
|
|
160
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
161
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
177
162
|
Requires-Dist: flet-video; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist:
|
|
163
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
164
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
165
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
166
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
167
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
168
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
169
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
170
|
+
Requires-Dist: pydantic; extra == "all"
|
|
181
171
|
Requires-Dist: sre_yield; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
172
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
173
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
174
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
175
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
176
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
177
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
178
|
+
Requires-Dist: tabulate; extra == "all"
|
|
179
|
+
Requires-Dist: diskcache; extra == "all"
|
|
180
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
181
|
+
Requires-Dist: google-auth; extra == "all"
|
|
182
|
+
Requires-Dist: logfire; extra == "all"
|
|
183
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -39,7 +39,7 @@ class Proxy(server.Plain):
|
|
|
39
39
|
"""
|
|
40
40
|
exchange.is_complete = True
|
|
41
41
|
|
|
42
|
-
def resolve(self, exchange: Exchange) -> Exchange:
|
|
42
|
+
async def resolve(self, exchange: Exchange) -> Exchange:
|
|
43
43
|
"""
|
|
44
44
|
|
|
45
45
|
Resolve a request, processing each stage, initial question, upstream response etc.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
from dataclasses import dataclass
|
|
1
|
+
import asyncio
|
|
2
|
+
import dns.rcode
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
4
|
from datetime import timedelta
|
|
5
5
|
from functools import cached_property
|
|
6
|
+
from typing import Optional
|
|
6
7
|
|
|
7
8
|
from fmtr.tools import caching_tools as caching
|
|
8
9
|
from fmtr.tools.dns_tools.dm import Exchange
|
|
@@ -10,59 +11,61 @@ from fmtr.tools.logging_tools import logger
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@dataclass(kw_only=True, eq=False)
|
|
13
|
-
class Plain:
|
|
14
|
+
class Plain(asyncio.DatagramProtocol):
|
|
14
15
|
"""
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
Async base class for a plain DNS server using asyncio DatagramProtocol.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
host: str
|
|
21
21
|
port: int
|
|
22
|
+
transport: Optional[asyncio.DatagramTransport] = field(default=None, init=False)
|
|
22
23
|
|
|
23
24
|
@cached_property
|
|
24
|
-
def
|
|
25
|
-
return
|
|
25
|
+
def loop(self):
|
|
26
|
+
return asyncio.get_event_loop()
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
@cached_property
|
|
28
30
|
def cache(self):
|
|
29
31
|
"""
|
|
30
32
|
|
|
31
33
|
Overridable cache.
|
|
32
|
-
|
|
33
34
|
"""
|
|
34
35
|
cache = caching.TLRU(maxsize=1_024, ttu_static=timedelta(hours=1), desc='DNS Request')
|
|
35
36
|
return cache
|
|
36
37
|
|
|
37
|
-
def
|
|
38
|
-
|
|
38
|
+
def connection_made(self, transport: asyncio.DatagramTransport):
|
|
39
|
+
self.transport = transport
|
|
40
|
+
logger.info(f'Listening on {self.host}:{self.port}')
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
def datagram_received(self, data: bytes, addr):
|
|
43
|
+
ip, port = addr
|
|
44
|
+
exchange = Exchange.from_wire(data, ip=ip, port=port)
|
|
45
|
+
asyncio.create_task(self.handle(exchange))
|
|
41
46
|
|
|
47
|
+
async def start(self):
|
|
42
48
|
"""
|
|
43
|
-
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
44
|
-
sock.bind((self.host, self.port))
|
|
45
|
-
logger.info(f'Listening on {self.host}:{self.port}')
|
|
46
|
-
while True:
|
|
47
|
-
data, (ip, port) = sock.recvfrom(512)
|
|
48
|
-
exchange = Exchange.from_wire(data, ip=ip, port=port)
|
|
49
|
-
self.handle(exchange)
|
|
50
|
-
sock.sendto(exchange.response.message.to_wire(), (ip, port))
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
Start the async UDP server.
|
|
53
51
|
"""
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
logger.info(f'Starting async DNS server on {self.host}:{self.port}...')
|
|
54
|
+
await self.loop.create_datagram_endpoint(
|
|
55
|
+
lambda: self,
|
|
56
|
+
local_addr=(self.host, self.port)
|
|
57
|
+
)
|
|
58
|
+
await asyncio.Future() # Prevent exit by blocking forever
|
|
56
59
|
|
|
60
|
+
async def resolve(self, exchange: Exchange) -> Exchange:
|
|
57
61
|
"""
|
|
58
|
-
raise NotImplemented
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
Check cache, patch in in new ID and mark complete
|
|
63
|
+
To be defined in subclasses.
|
|
64
64
|
|
|
65
65
|
"""
|
|
66
|
+
raise NotImplementedError
|
|
67
|
+
|
|
68
|
+
def check_cache(self, exchange: Exchange):
|
|
66
69
|
if exchange.key in self.cache:
|
|
67
70
|
logger.info(f'Request found in cache.')
|
|
68
71
|
exchange.response = self.cache[exchange.key]
|
|
@@ -89,7 +92,6 @@ class Plain:
|
|
|
89
92
|
"""
|
|
90
93
|
request = exchange.request
|
|
91
94
|
response = exchange.response
|
|
92
|
-
|
|
93
95
|
logger.info(
|
|
94
96
|
f'Resolution complete {exchange.client_name=} {request.message.id=} {request.type_text} {request.name_text} {request.question=} {exchange.is_complete=} {response.rcode=} {response.rcode_text=} {response.answer=} {response.blocked_by=}...'
|
|
95
97
|
)
|
|
@@ -100,24 +102,20 @@ class Plain:
|
|
|
100
102
|
Warn about any errors
|
|
101
103
|
|
|
102
104
|
"""
|
|
105
|
+
if exchange.response.rcode != dns.rcode.NOERROR:
|
|
106
|
+
logger.warning(f'Error {exchange.response.rcode_text=}')
|
|
103
107
|
|
|
104
|
-
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
logger.warning(f'Error {exchange.response.rcode_text=}')
|
|
108
|
-
|
|
109
|
-
def handle(self, exchange: Exchange):
|
|
108
|
+
async def handle(self, exchange: Exchange):
|
|
110
109
|
"""
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
Warn about any errors
|
|
113
112
|
|
|
114
113
|
"""
|
|
115
|
-
|
|
116
114
|
if not exchange.request.is_valid:
|
|
117
115
|
raise ValueError(f'Only one question per request is supported. Got {len(exchange.request.question)} questions.')
|
|
118
116
|
|
|
119
117
|
if not exchange.is_internal:
|
|
120
|
-
self.handle(exchange.reverse)
|
|
118
|
+
await self.handle(exchange.reverse)
|
|
121
119
|
client_name = exchange.reverse.question_last.name.to_text()
|
|
122
120
|
if not exchange.reverse.response.answer:
|
|
123
121
|
logger.warning(f'Client name could not be resolved {client_name=}.')
|
|
@@ -128,10 +126,10 @@ class Plain:
|
|
|
128
126
|
self.check_cache(exchange)
|
|
129
127
|
|
|
130
128
|
if not exchange.is_complete:
|
|
131
|
-
exchange = self.resolve(exchange)
|
|
129
|
+
exchange = await self.resolve(exchange)
|
|
132
130
|
self.cache[exchange.key] = exchange.response
|
|
133
131
|
|
|
134
132
|
self.log_dns_errors(exchange)
|
|
135
133
|
self.log_response(exchange)
|
|
136
134
|
|
|
137
|
-
|
|
135
|
+
self.transport.sendto(exchange.response.message.to_wire(), exchange.addr)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.17
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.17
|
|
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: filetype; extra == "all"
|
|
130
|
-
Requires-Dist: pyyaml; extra == "all"
|
|
131
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
132
|
-
Requires-Dist: tinynetrc; extra == "all"
|
|
133
|
-
Requires-Dist: flet[all]; extra == "all"
|
|
134
|
-
Requires-Dist: tabulate; extra == "all"
|
|
135
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
136
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
137
|
-
Requires-Dist: docker; extra == "all"
|
|
138
129
|
Requires-Dist: Unidecode; extra == "all"
|
|
139
|
-
Requires-Dist:
|
|
140
|
-
Requires-Dist:
|
|
141
|
-
Requires-Dist: deepmerge; extra == "all"
|
|
142
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
143
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
144
|
-
Requires-Dist: torchaudio; extra == "all"
|
|
145
|
-
Requires-Dist: logfire; extra == "all"
|
|
146
|
-
Requires-Dist: diskcache; extra == "all"
|
|
147
|
-
Requires-Dist: cachetools; extra == "all"
|
|
130
|
+
Requires-Dist: semver; extra == "all"
|
|
131
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
148
132
|
Requires-Dist: setuptools; extra == "all"
|
|
149
|
-
Requires-Dist:
|
|
150
|
-
Requires-Dist:
|
|
133
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
134
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
135
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
136
|
+
Requires-Dist: docker; extra == "all"
|
|
137
|
+
Requires-Dist: bokeh; extra == "all"
|
|
138
|
+
Requires-Dist: filetype; extra == "all"
|
|
139
|
+
Requires-Dist: torchvision; extra == "all"
|
|
151
140
|
Requires-Dist: faker; extra == "all"
|
|
152
|
-
Requires-Dist:
|
|
153
|
-
Requires-Dist: google-auth; extra == "all"
|
|
141
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
154
142
|
Requires-Dist: fastapi; extra == "all"
|
|
155
|
-
Requires-Dist: peft; extra == "all"
|
|
156
|
-
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
157
|
-
Requires-Dist: yamlscript; extra == "all"
|
|
158
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
159
|
-
Requires-Dist: torchvision; extra == "all"
|
|
160
|
-
Requires-Dist: appdirs; extra == "all"
|
|
161
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
162
|
-
Requires-Dist: logfire[httpx]; extra == "all"
|
|
163
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
164
143
|
Requires-Dist: regex; extra == "all"
|
|
165
|
-
Requires-Dist: pydantic; extra == "all"
|
|
166
|
-
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
167
144
|
Requires-Dist: openai; extra == "all"
|
|
168
|
-
Requires-Dist:
|
|
169
|
-
Requires-Dist:
|
|
145
|
+
Requires-Dist: appdirs; extra == "all"
|
|
146
|
+
Requires-Dist: httpx; extra == "all"
|
|
147
|
+
Requires-Dist: distributed; extra == "all"
|
|
148
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
149
|
+
Requires-Dist: peft; extra == "all"
|
|
150
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
151
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
170
152
|
Requires-Dist: json_repair; extra == "all"
|
|
171
|
-
Requires-Dist:
|
|
153
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
154
|
+
Requires-Dist: cachetools; extra == "all"
|
|
155
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
156
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
172
157
|
Requires-Dist: html2text; extra == "all"
|
|
173
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
174
|
-
Requires-Dist: semver; extra == "all"
|
|
175
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
176
158
|
Requires-Dist: ollama; extra == "all"
|
|
159
|
+
Requires-Dist: pandas; extra == "all"
|
|
160
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
161
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
177
162
|
Requires-Dist: flet-video; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist:
|
|
163
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
164
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
165
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
166
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
167
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
168
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
169
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
170
|
+
Requires-Dist: pydantic; extra == "all"
|
|
181
171
|
Requires-Dist: sre_yield; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
172
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
173
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
174
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
175
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
176
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
177
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
178
|
+
Requires-Dist: tabulate; extra == "all"
|
|
179
|
+
Requires-Dist: diskcache; extra == "all"
|
|
180
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
181
|
+
Requires-Dist: google-auth; extra == "all"
|
|
182
|
+
Requires-Dist: logfire; extra == "all"
|
|
183
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.16
|
|
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
|
-
filetype
|
|
18
|
-
pyyaml
|
|
19
|
-
huggingface_hub
|
|
20
|
-
tinynetrc
|
|
21
|
-
flet[all]
|
|
22
|
-
tabulate
|
|
23
|
-
pydantic-settings
|
|
24
|
-
flet-webview
|
|
25
|
-
docker
|
|
26
17
|
Unidecode
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
deepmerge
|
|
30
|
-
pymupdf
|
|
31
|
-
google-auth-oauthlib
|
|
32
|
-
torchaudio
|
|
33
|
-
logfire
|
|
34
|
-
diskcache
|
|
35
|
-
cachetools
|
|
18
|
+
semver
|
|
19
|
+
google-auth-httplib2
|
|
36
20
|
setuptools
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
dask[bag]
|
|
22
|
+
httpx_retries
|
|
23
|
+
flet-webview
|
|
24
|
+
docker
|
|
25
|
+
bokeh
|
|
26
|
+
filetype
|
|
27
|
+
torchvision
|
|
39
28
|
faker
|
|
40
|
-
|
|
41
|
-
google-auth
|
|
29
|
+
uvicorn[standard]
|
|
42
30
|
fastapi
|
|
43
|
-
peft
|
|
44
|
-
transformers[sentencepiece]
|
|
45
|
-
yamlscript
|
|
46
|
-
contexttimer
|
|
47
|
-
torchvision
|
|
48
|
-
appdirs
|
|
49
|
-
google-auth-httplib2
|
|
50
|
-
logfire[httpx]
|
|
51
|
-
pytest-cov
|
|
52
31
|
regex
|
|
53
|
-
pydantic
|
|
54
|
-
pydevd-pycharm~=251.25410.159
|
|
55
32
|
openai
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
appdirs
|
|
34
|
+
httpx
|
|
35
|
+
distributed
|
|
36
|
+
google-api-python-client
|
|
37
|
+
peft
|
|
38
|
+
google-auth-oauthlib
|
|
39
|
+
pyyaml
|
|
58
40
|
json_repair
|
|
59
|
-
|
|
41
|
+
deepmerge
|
|
42
|
+
cachetools
|
|
43
|
+
flet[all]
|
|
44
|
+
pydevd-pycharm~=251.25410.159
|
|
60
45
|
html2text
|
|
61
|
-
pydantic-ai[logfire,openai]
|
|
62
|
-
semver
|
|
63
|
-
dnspython[doh]
|
|
64
46
|
ollama
|
|
47
|
+
pandas
|
|
48
|
+
pymupdf4llm
|
|
49
|
+
pydantic-settings
|
|
65
50
|
flet-video
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
sentence_transformers
|
|
52
|
+
pymupdf
|
|
53
|
+
logfire[httpx]
|
|
54
|
+
huggingface_hub
|
|
55
|
+
openpyxl
|
|
56
|
+
contexttimer
|
|
57
|
+
yamlscript
|
|
58
|
+
pydantic
|
|
69
59
|
sre_yield
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
pydantic-ai[logfire,openai]
|
|
61
|
+
tokenizers
|
|
62
|
+
torchaudio
|
|
63
|
+
logfire[fastapi]
|
|
64
|
+
pytest-cov
|
|
65
|
+
tinynetrc
|
|
66
|
+
tabulate
|
|
67
|
+
diskcache
|
|
68
|
+
transformers[sentencepiece]
|
|
69
|
+
google-auth
|
|
70
|
+
logfire
|
|
71
|
+
dnspython[doh]
|
|
72
72
|
|
|
73
73
|
[api]
|
|
74
74
|
fastapi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|