fmtr.tools 1.3.19__py3-none-any.whl → 1.3.21__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.

@@ -2,5 +2,6 @@ from fmtr.tools.import_tools import MissingExtraMockModule
2
2
 
3
3
  try:
4
4
  from fmtr.tools.dns_tools import server, client, dm, proxy
5
+ import dns
5
6
  except ImportError as exception:
6
- server = client = dm = proxy = MissingExtraMockModule('dns', exception)
7
+ dns = server = client = dm = proxy = MissingExtraMockModule('dns', exception)
@@ -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 = query.udp(q=exchange.query_last, where=self.host, port=self.port)
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 = dnspython.message.make_query(self.host, dnspython.rdatatype.A, flags=0)
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(dnspython.rcode.SERVFAIL)
95
+ exchange.response.message.set_rcode(dnspython_rcode.SERVFAIL)
97
96
  exchange.response.is_complete = True
98
97
  logger.exception(exception)
@@ -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 dnsrcode
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
- dnsrcode.NOERROR: 300, # Successful query
15
- dnsrcode.FORMERR: 60, # Format error
16
- dnsrcode.SERVFAIL: 10, # Server failure
17
- dnsrcode.NXDOMAIN: 60 * 60, # Non-existent domain
18
- dnsrcode.NOTIMP: 60, # Not implemented
19
- dnsrcode.REFUSED: 60, # Refused
20
- dnsrcode.YXDOMAIN: 600, # Name exists when it should not
21
- dnsrcode.YXRRSET: 600, # RR Set exists when it should not
22
- dnsrcode.NXRRSET: 300, # RR Set that should exist does not
23
- dnsrcode.NOTAUTH: 60, # Not authorized
24
- dnsrcode.NOTZONE: 60 # Name not contained in zone
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) -> dnsrcode.Rcode:
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 dnsrcode.to_text(self.rcode)
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, dnsrcode.NXDOMAIN)
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 = reversename.from_address(self.ip)
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
@@ -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 != dns.rcode.NOERROR:
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):
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.19
1
+ 1.3.21
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.19
3
+ Version: 1.3.21
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-webview; extra == "all"
130
- Requires-Dist: transformers[sentencepiece]; extra == "all"
131
- Requires-Dist: distributed; extra == "all"
129
+ Requires-Dist: uvicorn[standard]; extra == "all"
130
+ Requires-Dist: logfire; extra == "all"
131
+ Requires-Dist: tokenizers; extra == "all"
132
+ Requires-Dist: pandas; extra == "all"
133
+ Requires-Dist: httpx; extra == "all"
134
+ Requires-Dist: setuptools; extra == "all"
135
+ Requires-Dist: Unidecode; extra == "all"
132
136
  Requires-Dist: html2text; extra == "all"
133
- Requires-Dist: regex; extra == "all"
134
- Requires-Dist: torchaudio; extra == "all"
137
+ Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
138
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
139
+ Requires-Dist: httpx_retries; extra == "all"
140
+ Requires-Dist: filetype; extra == "all"
141
+ Requires-Dist: dask[bag]; extra == "all"
142
+ Requires-Dist: pydantic; extra == "all"
143
+ Requires-Dist: pymupdf4llm; extra == "all"
144
+ Requires-Dist: docker; extra == "all"
145
+ Requires-Dist: google-auth-httplib2; extra == "all"
146
+ Requires-Dist: flet-webview; extra == "all"
147
+ Requires-Dist: openpyxl; extra == "all"
148
+ Requires-Dist: openai; extra == "all"
149
+ Requires-Dist: logfire[fastapi]; extra == "all"
150
+ Requires-Dist: bokeh; extra == "all"
135
151
  Requires-Dist: google-api-python-client; extra == "all"
136
- Requires-Dist: logfire[httpx]; extra == "all"
137
- Requires-Dist: setuptools; extra == "all"
138
- Requires-Dist: httpx; extra == "all"
139
- Requires-Dist: google-auth-oauthlib; extra == "all"
140
- Requires-Dist: torchvision; extra == "all"
141
- Requires-Dist: pandas; extra == "all"
142
- Requires-Dist: cachetools; extra == "all"
143
- Requires-Dist: pytest-cov; extra == "all"
152
+ Requires-Dist: pyyaml; extra == "all"
144
153
  Requires-Dist: yamlscript; extra == "all"
145
- Requires-Dist: pymupdf4llm; extra == "all"
154
+ Requires-Dist: google-auth-oauthlib; extra == "all"
155
+ Requires-Dist: json_repair; extra == "all"
156
+ Requires-Dist: sentence_transformers; extra == "all"
146
157
  Requires-Dist: peft; extra == "all"
147
- Requires-Dist: ollama; extra == "all"
148
- Requires-Dist: openai; extra == "all"
149
- Requires-Dist: Unidecode; extra == "all"
150
158
  Requires-Dist: diskcache; extra == "all"
151
- Requires-Dist: contexttimer; extra == "all"
152
- Requires-Dist: huggingface_hub; extra == "all"
153
- Requires-Dist: fastapi; extra == "all"
154
- Requires-Dist: logfire; extra == "all"
155
- Requires-Dist: google-auth-httplib2; extra == "all"
156
- Requires-Dist: tokenizers; extra == "all"
157
- Requires-Dist: json_repair; extra == "all"
158
- Requires-Dist: httpx_retries; extra == "all"
159
- Requires-Dist: pyyaml; extra == "all"
160
- Requires-Dist: google-auth; extra == "all"
161
- Requires-Dist: logfire[fastapi]; extra == "all"
159
+ Requires-Dist: cachetools; extra == "all"
160
+ Requires-Dist: sre_yield; extra == "all"
162
161
  Requires-Dist: faker; extra == "all"
163
162
  Requires-Dist: tabulate; extra == "all"
164
- Requires-Dist: deepmerge; extra == "all"
165
- Requires-Dist: docker; extra == "all"
166
- Requires-Dist: flet-video; extra == "all"
167
- Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
168
- Requires-Dist: sre_yield; extra == "all"
169
163
  Requires-Dist: pymupdf; extra == "all"
170
- Requires-Dist: filetype; extra == "all"
171
- Requires-Dist: bokeh; extra == "all"
172
- Requires-Dist: sentence_transformers; extra == "all"
173
- Requires-Dist: pydantic-settings; extra == "all"
174
- Requires-Dist: dask[bag]; extra == "all"
175
- Requires-Dist: semver; extra == "all"
164
+ Requires-Dist: pytest-cov; extra == "all"
165
+ Requires-Dist: google-auth; extra == "all"
176
166
  Requires-Dist: appdirs; extra == "all"
177
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
178
- Requires-Dist: dnspython[doh]; extra == "all"
179
- Requires-Dist: pydantic; extra == "all"
167
+ Requires-Dist: pydantic-settings; extra == "all"
168
+ Requires-Dist: regex; extra == "all"
169
+ Requires-Dist: torchvision; extra == "all"
170
+ Requires-Dist: distributed; extra == "all"
171
+ Requires-Dist: torchaudio; extra == "all"
172
+ Requires-Dist: deepmerge; extra == "all"
173
+ Requires-Dist: fastapi; extra == "all"
180
174
  Requires-Dist: flet[all]; extra == "all"
175
+ Requires-Dist: huggingface_hub; extra == "all"
176
+ Requires-Dist: dnspython[doh]; extra == "all"
177
+ Requires-Dist: ollama; extra == "all"
178
+ Requires-Dist: contexttimer; extra == "all"
179
+ Requires-Dist: semver; extra == "all"
180
+ Requires-Dist: flet-video; extra == "all"
181
+ Requires-Dist: logfire[httpx]; extra == "all"
181
182
  Requires-Dist: tinynetrc; extra == "all"
182
- Requires-Dist: openpyxl; extra == "all"
183
- Requires-Dist: uvicorn[standard]; extra == "all"
183
+ Requires-Dist: transformers[sentencepiece]; 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=IkHMYSQ-ZduD7nl7WkIfpgHFu3tdHPQP47CtOYb2gsM,6
47
+ fmtr/tools/version,sha256=cvhadKKPw11qd560krb_gX5ym6Wvv3xEb6FFkldcumQ,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
- fmtr/tools/dns_tools/__init__.py,sha256=PjD3Og6D5yvDVpKmsUsrnSpz_rjXpl4zBtvMqm8xKWU,237
53
- fmtr/tools/dns_tools/client.py,sha256=uUFoFRwoPtetPVH6PZ3ssHmx3WEquT6UW4FCBKq4n74,2722
54
- fmtr/tools/dns_tools/dm.py,sha256=DOXcySjcnwviz8tQXjl34W_hz1bh0ue-ew7aNylvOfo,6553
52
+ fmtr/tools/dns_tools/__init__.py,sha256=Mzaepy8lEdT0SJtUOCnF3IkpOt0vrZn-IOgOf4xfd8Q,258
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=TN2ds53lpkhEE-tZBJlNeXqh0Fxq-56XKvF-ruHOf9M,4233
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.19.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
80
- fmtr_tools-1.3.19.dist-info/METADATA,sha256=WoledZuozS64C9mggi1Ir6kgWC88fpePaALih3iil5c,15938
81
- fmtr_tools-1.3.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
- fmtr_tools-1.3.19.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
83
- fmtr_tools-1.3.19.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
84
- fmtr_tools-1.3.19.dist-info/RECORD,,
79
+ fmtr_tools-1.3.21.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
80
+ fmtr_tools-1.3.21.dist-info/METADATA,sha256=maUC1a0Pjda8V8J5YTJhkSKa-YQLW_QU4cfaSUCOHMo,15938
81
+ fmtr_tools-1.3.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
+ fmtr_tools-1.3.21.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
83
+ fmtr_tools-1.3.21.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
84
+ fmtr_tools-1.3.21.dist-info/RECORD,,