fmtr.tools 1.3.18__py3-none-any.whl → 1.3.20__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/dns_tools/client.py +4 -5
- fmtr/tools/dns_tools/dm.py +16 -17
- fmtr/tools/dns_tools/server.py +5 -2
- fmtr/tools/version +1 -1
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/METADATA +44 -44
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/RECORD +10 -10
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/WHEEL +0 -0
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/entry_points.txt +0 -0
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/licenses/LICENSE +0 -0
- {fmtr_tools-1.3.18.dist-info → fmtr_tools-1.3.20.dist-info}/top_level.txt +0 -0
fmtr/tools/dns_tools/client.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import dns as dnspython
|
|
2
1
|
from dataclasses import dataclass
|
|
3
|
-
from dns import query
|
|
2
|
+
from dns import query as dnspython_query, message as dnspython_message, rdatatype as dnspython_rdatatype, rcode as dnspython_rcode
|
|
4
3
|
from functools import cached_property
|
|
5
4
|
from httpx_retries import Retry, RetryTransport
|
|
6
5
|
from typing import Optional
|
|
@@ -44,7 +43,7 @@ class Plain:
|
|
|
44
43
|
def resolve(self, exchange: Exchange):
|
|
45
44
|
|
|
46
45
|
with logger.span(f'UDP {self.host}:{self.port}'):
|
|
47
|
-
response_plain =
|
|
46
|
+
response_plain = dnspython_query.udp(q=exchange.query_last, where=self.host, port=self.port)
|
|
48
47
|
response = Response.from_message(response_plain)
|
|
49
48
|
for answer in response.message.answer:
|
|
50
49
|
answer.ttl = max(answer.ttl, self.ttl_min or answer.ttl)
|
|
@@ -70,7 +69,7 @@ class HTTP:
|
|
|
70
69
|
|
|
71
70
|
@cached_property
|
|
72
71
|
def ip(self):
|
|
73
|
-
message =
|
|
72
|
+
message = dnspython_message.make_query(self.host, dnspython_rdatatype.A, flags=0)
|
|
74
73
|
exchange = Exchange.from_wire(message.to_wire(), ip=None, port=None)
|
|
75
74
|
self.BOOTSTRAP.resolve(exchange)
|
|
76
75
|
ip = next(iter(exchange.response.answer.items.keys())).address
|
|
@@ -93,6 +92,6 @@ class HTTP:
|
|
|
93
92
|
exchange.response = response
|
|
94
93
|
|
|
95
94
|
except Exception as exception:
|
|
96
|
-
exchange.response.message.set_rcode(
|
|
95
|
+
exchange.response.message.set_rcode(dnspython_rcode.SERVFAIL)
|
|
97
96
|
exchange.response.is_complete = True
|
|
98
97
|
logger.exception(exception)
|
fmtr/tools/dns_tools/dm.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import dns
|
|
2
2
|
import httpx
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from dns import rcode as
|
|
5
|
-
from dns import reversename
|
|
4
|
+
from dns import rcode as dnspython_rcode, reversename as dnspython_reversename
|
|
6
5
|
from dns.message import Message, QueryMessage
|
|
7
6
|
from dns.rrset import RRset
|
|
8
7
|
from functools import cached_property
|
|
@@ -11,17 +10,17 @@ from typing import Self, Optional, List
|
|
|
11
10
|
from fmtr.tools.string_tools import join
|
|
12
11
|
|
|
13
12
|
TTL_CODE_DEFAULTS = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
dnspython_rcode.NOERROR: 300, # Successful query
|
|
14
|
+
dnspython_rcode.FORMERR: 60, # Format error
|
|
15
|
+
dnspython_rcode.SERVFAIL: 10, # Server failure
|
|
16
|
+
dnspython_rcode.NXDOMAIN: 60 * 60, # Non-existent domain
|
|
17
|
+
dnspython_rcode.NOTIMP: 60, # Not implemented
|
|
18
|
+
dnspython_rcode.REFUSED: 60, # Refused
|
|
19
|
+
dnspython_rcode.YXDOMAIN: 600, # Name exists when it should not
|
|
20
|
+
dnspython_rcode.YXRRSET: 600, # RR Set exists when it should not
|
|
21
|
+
dnspython_rcode.NXRRSET: 300, # RR Set that should exist does not
|
|
22
|
+
dnspython_rcode.NOTAUTH: 60, # Not authorized
|
|
23
|
+
dnspython_rcode.NOTZONE: 60 # Name not contained in zone
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
@dataclass
|
|
@@ -74,12 +73,12 @@ class Response(BaseDNSData):
|
|
|
74
73
|
return self.message.answer[-1]
|
|
75
74
|
|
|
76
75
|
@property
|
|
77
|
-
def rcode(self) ->
|
|
76
|
+
def rcode(self) -> dnspython_rcode.Rcode:
|
|
78
77
|
return self.message.rcode()
|
|
79
78
|
|
|
80
79
|
@property
|
|
81
80
|
def rcode_text(self) -> str:
|
|
82
|
-
return
|
|
81
|
+
return dnspython_rcode.to_text(self.rcode)
|
|
83
82
|
|
|
84
83
|
@property
|
|
85
84
|
def ttl(self) -> int:
|
|
@@ -94,7 +93,7 @@ class Response(BaseDNSData):
|
|
|
94
93
|
ttl = min(ttls)
|
|
95
94
|
return ttl
|
|
96
95
|
|
|
97
|
-
ttl = TTL_CODE_DEFAULTS.get(self.rcode,
|
|
96
|
+
ttl = TTL_CODE_DEFAULTS.get(self.rcode, dnspython_rcode.NXDOMAIN)
|
|
98
97
|
return ttl
|
|
99
98
|
|
|
100
99
|
|
|
@@ -252,7 +251,7 @@ class Exchange:
|
|
|
252
251
|
Create an Exchange for a reverse lookup of this Exchange's client IP.
|
|
253
252
|
|
|
254
253
|
"""
|
|
255
|
-
name =
|
|
254
|
+
name = dnspython_reversename.from_address(self.ip)
|
|
256
255
|
query = dns.message.make_query(name, dns.rdatatype.PTR)
|
|
257
256
|
exchange = self.__class__.from_wire(query.to_wire(), ip=self.ip, port=self.port, is_internal=True)
|
|
258
257
|
return exchange
|
fmtr/tools/dns_tools/server.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import dns.rcode
|
|
3
2
|
from dataclasses import dataclass, field
|
|
4
3
|
from datetime import timedelta
|
|
4
|
+
from dns import rcode as dnspython_rcode
|
|
5
5
|
from functools import cached_property
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
@@ -102,7 +102,7 @@ class Plain(asyncio.DatagramProtocol):
|
|
|
102
102
|
Warn about any errors
|
|
103
103
|
|
|
104
104
|
"""
|
|
105
|
-
if exchange.response.rcode !=
|
|
105
|
+
if exchange.response.rcode != dnspython_rcode.NOERROR:
|
|
106
106
|
logger.warning(f'Error {exchange.response.rcode_text=}')
|
|
107
107
|
|
|
108
108
|
async def handle(self, exchange: Exchange):
|
|
@@ -132,4 +132,7 @@ class Plain(asyncio.DatagramProtocol):
|
|
|
132
132
|
self.log_dns_errors(exchange)
|
|
133
133
|
self.log_response(exchange)
|
|
134
134
|
|
|
135
|
+
if exchange.is_internal:
|
|
136
|
+
return
|
|
137
|
+
|
|
135
138
|
self.transport.sendto(exchange.response.message.to_wire(), exchange.addr)
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.20
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.20
|
|
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: flet[all]; extra == "all"
|
|
130
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
131
|
-
Requires-Dist: pyyaml; extra == "all"
|
|
132
|
-
Requires-Dist: bokeh; extra == "all"
|
|
133
|
-
Requires-Dist: docker; extra == "all"
|
|
134
129
|
Requires-Dist: json_repair; extra == "all"
|
|
135
|
-
Requires-Dist:
|
|
136
|
-
Requires-Dist: appdirs; extra == "all"
|
|
137
|
-
Requires-Dist: pydantic; extra == "all"
|
|
138
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
139
|
-
Requires-Dist: logfire[httpx]; extra == "all"
|
|
140
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
141
|
-
Requires-Dist: google-auth; extra == "all"
|
|
142
|
-
Requires-Dist: html2text; extra == "all"
|
|
130
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
143
131
|
Requires-Dist: Unidecode; extra == "all"
|
|
144
|
-
Requires-Dist:
|
|
145
|
-
Requires-Dist:
|
|
132
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
133
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
134
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
146
135
|
Requires-Dist: openpyxl; extra == "all"
|
|
147
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
148
|
-
Requires-Dist: openai; extra == "all"
|
|
149
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
150
|
-
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
151
|
-
Requires-Dist: pandas; extra == "all"
|
|
152
|
-
Requires-Dist: setuptools; extra == "all"
|
|
153
136
|
Requires-Dist: fastapi; extra == "all"
|
|
154
|
-
Requires-Dist:
|
|
155
|
-
Requires-Dist:
|
|
137
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
138
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
139
|
+
Requires-Dist: appdirs; extra == "all"
|
|
140
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
141
|
+
Requires-Dist: faker; extra == "all"
|
|
142
|
+
Requires-Dist: filetype; extra == "all"
|
|
156
143
|
Requires-Dist: torchaudio; extra == "all"
|
|
157
|
-
Requires-Dist:
|
|
158
|
-
Requires-Dist:
|
|
159
|
-
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
160
|
-
Requires-Dist: deepmerge; extra == "all"
|
|
161
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
162
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
144
|
+
Requires-Dist: setuptools; extra == "all"
|
|
145
|
+
Requires-Dist: regex; extra == "all"
|
|
163
146
|
Requires-Dist: flet-video; extra == "all"
|
|
164
147
|
Requires-Dist: pymupdf4llm; extra == "all"
|
|
165
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
166
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
167
|
-
Requires-Dist: semver; extra == "all"
|
|
168
|
-
Requires-Dist: distributed; extra == "all"
|
|
169
148
|
Requires-Dist: pydantic-settings; extra == "all"
|
|
149
|
+
Requires-Dist: pydantic; extra == "all"
|
|
150
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
151
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
152
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
153
|
+
Requires-Dist: diskcache; extra == "all"
|
|
170
154
|
Requires-Dist: tabulate; extra == "all"
|
|
155
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
156
|
+
Requires-Dist: pandas; extra == "all"
|
|
171
157
|
Requires-Dist: cachetools; extra == "all"
|
|
172
|
-
Requires-Dist:
|
|
173
|
-
Requires-Dist:
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
158
|
+
Requires-Dist: bokeh; extra == "all"
|
|
159
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
160
|
+
Requires-Dist: docker; extra == "all"
|
|
161
|
+
Requires-Dist: logfire; extra == "all"
|
|
162
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
163
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
164
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
165
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
177
166
|
Requires-Dist: torchvision; extra == "all"
|
|
178
|
-
Requires-Dist:
|
|
167
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
168
|
+
Requires-Dist: google-auth; extra == "all"
|
|
169
|
+
Requires-Dist: distributed; extra == "all"
|
|
170
|
+
Requires-Dist: html2text; extra == "all"
|
|
179
171
|
Requires-Dist: httpx; extra == "all"
|
|
180
|
-
Requires-Dist:
|
|
181
|
-
Requires-Dist:
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
172
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
173
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
174
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
175
|
+
Requires-Dist: peft; extra == "all"
|
|
176
|
+
Requires-Dist: openai; extra == "all"
|
|
177
|
+
Requires-Dist: semver; extra == "all"
|
|
178
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
179
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
180
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
181
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
182
|
+
Requires-Dist: yamlscript; extra == "all"
|
|
183
|
+
Requires-Dist: ollama; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -44,16 +44,16 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,1
|
|
|
44
44
|
fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
|
|
45
45
|
fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
|
|
46
46
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
47
|
-
fmtr/tools/version,sha256=
|
|
47
|
+
fmtr/tools/version,sha256=9gUW_B3XD6hqBCvKuP1gvJ88VvVyeh3gSrb8ecLqXBg,6
|
|
48
48
|
fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
|
|
49
49
|
fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
|
|
50
50
|
fmtr/tools/ai_tools/agentic_tools.py,sha256=acSEPFS-aguDXanWGs3fAAlRyJSYPZW7L-Kb2qDLm-I,4300
|
|
51
51
|
fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
|
|
52
52
|
fmtr/tools/dns_tools/__init__.py,sha256=PjD3Og6D5yvDVpKmsUsrnSpz_rjXpl4zBtvMqm8xKWU,237
|
|
53
|
-
fmtr/tools/dns_tools/client.py,sha256=
|
|
54
|
-
fmtr/tools/dns_tools/dm.py,sha256=
|
|
53
|
+
fmtr/tools/dns_tools/client.py,sha256=IBbd7Xgx9ExTn_EPoL7ts9JfXokHHuOiD9m4K6tl1Q0,2817
|
|
54
|
+
fmtr/tools/dns_tools/dm.py,sha256=Lp1HaF7rpVtL_Ji4Bd32B29105H9ZKQ8AcVj_AB7nsA,6678
|
|
55
55
|
fmtr/tools/dns_tools/proxy.py,sha256=gCWfH1pyWjj8xnJ8Pm4id7bsBWqcar3dQ9PeP5XjRXY,1624
|
|
56
|
-
fmtr/tools/dns_tools/server.py,sha256=
|
|
56
|
+
fmtr/tools/dns_tools/server.py,sha256=_Y5w5bGHhBI32fYWl-SmnOALAw_eF9fEbmrOqqgzSq8,4263
|
|
57
57
|
fmtr/tools/entrypoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
fmtr/tools/entrypoints/cache_hfh.py,sha256=fQNs4J9twQuZH_Yj98-oOvEX7-LrSUP3kO8nzw2HrHs,60
|
|
59
59
|
fmtr/tools/entrypoints/ep_test.py,sha256=B8HfWISfSgw_xVX475CbJGh_QnpOe9MH65H8qGjTWbY,46
|
|
@@ -76,9 +76,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
|
|
|
76
76
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
77
77
|
fmtr/tools/version_tools/__init__.py,sha256=pg4iLtmIr5HtyEW_j0fMFoIdzqi_w9xH8-grQaXLB28,318
|
|
78
78
|
fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
|
|
79
|
-
fmtr_tools-1.3.
|
|
80
|
-
fmtr_tools-1.3.
|
|
81
|
-
fmtr_tools-1.3.
|
|
82
|
-
fmtr_tools-1.3.
|
|
83
|
-
fmtr_tools-1.3.
|
|
84
|
-
fmtr_tools-1.3.
|
|
79
|
+
fmtr_tools-1.3.20.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
80
|
+
fmtr_tools-1.3.20.dist-info/METADATA,sha256=fe1iHpsE_wFrWq8mA2u_Q0Kt_HJUm5Rplq4aqqVWtqE,15938
|
|
81
|
+
fmtr_tools-1.3.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
82
|
+
fmtr_tools-1.3.20.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
|
|
83
|
+
fmtr_tools-1.3.20.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
|
|
84
|
+
fmtr_tools-1.3.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|