fmtr.tools 1.3.53__py3-none-any.whl → 1.3.54__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/__init__.py CHANGED
@@ -21,6 +21,7 @@ import fmtr.tools.string_tools as string
21
21
  from fmtr.tools import ai_tools as ai
22
22
  from fmtr.tools import datetime_tools as dt
23
23
  from fmtr.tools import dns_tools as dns
24
+ from fmtr.tools import docker_tools as docker
24
25
  from fmtr.tools import interface_tools as interface
25
26
  from fmtr.tools import version_tools as version
26
27
  from fmtr.tools.constants import Constants
@@ -40,11 +41,6 @@ try:
40
41
  except ModuleNotFoundError as exception:
41
42
  yaml = MissingExtraMockModule('yaml', exception)
42
43
 
43
- try:
44
- from fmtr.tools import docker_tools as docker
45
- from fmtr.tools.docker_tools import Container
46
- except ModuleNotFoundError as exception:
47
- docker = Container = MissingExtraMockModule('docker.api', exception)
48
44
 
49
45
  try:
50
46
  from fmtr.tools import parallel_tools as parallel
@@ -0,0 +1,6 @@
1
+ from fmtr.tools.import_tools import MissingExtraMockModule
2
+
3
+ try:
4
+ from python_on_whales import docker as client
5
+ except ModuleNotFoundError as exception:
6
+ client = MissingExtraMockModule('docker.client', exception)
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.53
1
+ 1.3.54
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.53
3
+ Version: 1.3.54
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
@@ -28,8 +28,8 @@ Provides-Extra: process
28
28
  Requires-Dist: logfire; extra == "process"
29
29
  Provides-Extra: profiling
30
30
  Requires-Dist: contexttimer; extra == "profiling"
31
- Provides-Extra: docker-api
32
- Requires-Dist: docker; extra == "docker-api"
31
+ Provides-Extra: docker-client
32
+ Requires-Dist: python-on-whales; extra == "docker-client"
33
33
  Provides-Extra: unicode
34
34
  Requires-Dist: Unidecode; extra == "unicode"
35
35
  Provides-Extra: version
@@ -154,68 +154,68 @@ Provides-Extra: db-document
154
154
  Requires-Dist: beanie[odm]; extra == "db-document"
155
155
  Requires-Dist: motor; extra == "db-document"
156
156
  Provides-Extra: all
157
- Requires-Dist: docker; extra == "all"
158
- Requires-Dist: yamlscript; extra == "all"
159
- Requires-Dist: pydantic-extra-types; extra == "all"
160
- Requires-Dist: flet-video; extra == "all"
161
- Requires-Dist: motor; extra == "all"
162
- Requires-Dist: json_repair; extra == "all"
163
- Requires-Dist: pydantic-settings; extra == "all"
164
- Requires-Dist: openai; extra == "all"
165
- Requires-Dist: torchvision; extra == "all"
166
- Requires-Dist: google-auth; extra == "all"
167
- Requires-Dist: distributed; extra == "all"
168
- Requires-Dist: cachetools; extra == "all"
169
- Requires-Dist: regex; extra == "all"
170
- Requires-Dist: pandas; extra == "all"
171
- Requires-Dist: playwright; extra == "all"
172
- Requires-Dist: pymupdf4llm; extra == "all"
173
- Requires-Dist: torchaudio; extra == "all"
157
+ Requires-Dist: pyyaml; extra == "all"
174
158
  Requires-Dist: google-api-python-client; extra == "all"
175
- Requires-Dist: faker; extra == "all"
176
- Requires-Dist: sentence_transformers; extra == "all"
177
- Requires-Dist: deepdiff; extra == "all"
178
- Requires-Dist: flet[all]; extra == "all"
179
- Requires-Dist: huggingface_hub; extra == "all"
180
- Requires-Dist: tokenizers; extra == "all"
181
- Requires-Dist: Unidecode; extra == "all"
159
+ Requires-Dist: openpyxl; extra == "all"
182
160
  Requires-Dist: google-auth-httplib2; extra == "all"
183
- Requires-Dist: uvicorn[standard]; extra == "all"
184
- Requires-Dist: diskcache; extra == "all"
185
- Requires-Dist: logfire[httpx]; extra == "all"
186
- Requires-Dist: dask[bag]; extra == "all"
187
- Requires-Dist: tabulate; extra == "all"
188
- Requires-Dist: google-auth-oauthlib; extra == "all"
189
- Requires-Dist: appdirs; extra == "all"
161
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
162
+ Requires-Dist: tokenizers; extra == "all"
190
163
  Requires-Dist: semver; extra == "all"
191
- Requires-Dist: httpx; extra == "all"
192
- Requires-Dist: httpx_retries; extra == "all"
193
- Requires-Dist: logfire; extra == "all"
194
- Requires-Dist: logfire[fastapi]; extra == "all"
195
- Requires-Dist: bokeh; extra == "all"
196
- Requires-Dist: transformers[sentencepiece]; extra == "all"
164
+ Requires-Dist: fastapi; extra == "all"
165
+ Requires-Dist: google-auth; extra == "all"
166
+ Requires-Dist: cachetools; extra == "all"
167
+ Requires-Dist: distributed; extra == "all"
168
+ Requires-Dist: sre_yield; extra == "all"
197
169
  Requires-Dist: contexttimer; extra == "all"
198
- Requires-Dist: deepmerge; extra == "all"
199
- Requires-Dist: pydantic; extra == "all"
200
- Requires-Dist: peft; extra == "all"
170
+ Requires-Dist: setuptools; extra == "all"
171
+ Requires-Dist: motor; extra == "all"
201
172
  Requires-Dist: tinynetrc; extra == "all"
173
+ Requires-Dist: uvicorn[standard]; extra == "all"
202
174
  Requires-Dist: html2text; extra == "all"
203
- Requires-Dist: flet-webview; extra == "all"
175
+ Requires-Dist: pydantic; extra == "all"
176
+ Requires-Dist: bokeh; extra == "all"
177
+ Requires-Dist: pydantic-extra-types; extra == "all"
178
+ Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
179
+ Requires-Dist: logfire; extra == "all"
204
180
  Requires-Dist: dnspython[doh]; extra == "all"
205
- Requires-Dist: ollama; extra == "all"
206
- Requires-Dist: filetype; extra == "all"
181
+ Requires-Dist: Unidecode; extra == "all"
182
+ Requires-Dist: torchaudio; extra == "all"
183
+ Requires-Dist: yamlscript; extra == "all"
184
+ Requires-Dist: huggingface_hub; extra == "all"
185
+ Requires-Dist: logfire[fastapi]; extra == "all"
186
+ Requires-Dist: pydantic-settings; extra == "all"
187
+ Requires-Dist: transformers[sentencepiece]; extra == "all"
188
+ Requires-Dist: logfire[httpx]; extra == "all"
189
+ Requires-Dist: faker; extra == "all"
190
+ Requires-Dist: tabulate; extra == "all"
191
+ Requires-Dist: torchvision; extra == "all"
192
+ Requires-Dist: pandas; extra == "all"
193
+ Requires-Dist: json_repair; extra == "all"
194
+ Requires-Dist: appdirs; extra == "all"
195
+ Requires-Dist: dask[bag]; extra == "all"
207
196
  Requires-Dist: beanie[odm]; extra == "all"
208
- Requires-Dist: pyyaml; extra == "all"
209
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
210
- Requires-Dist: openpyxl; extra == "all"
211
- Requires-Dist: pytest-cov; extra == "all"
212
- Requires-Dist: sre_yield; extra == "all"
213
- Requires-Dist: fastapi; extra == "all"
197
+ Requires-Dist: flet-video; extra == "all"
198
+ Requires-Dist: diskcache; extra == "all"
199
+ Requires-Dist: filetype; extra == "all"
200
+ Requires-Dist: deepdiff; extra == "all"
201
+ Requires-Dist: playwright; extra == "all"
202
+ Requires-Dist: ollama; extra == "all"
203
+ Requires-Dist: python-on-whales; extra == "all"
204
+ Requires-Dist: regex; extra == "all"
214
205
  Requires-Dist: pycountry; extra == "all"
206
+ Requires-Dist: flet[all]; extra == "all"
207
+ Requires-Dist: peft; extra == "all"
208
+ Requires-Dist: pymupdf4llm; extra == "all"
209
+ Requires-Dist: httpx; extra == "all"
210
+ Requires-Dist: google-auth-oauthlib; extra == "all"
215
211
  Requires-Dist: odfpy; extra == "all"
212
+ Requires-Dist: pytest-cov; extra == "all"
213
+ Requires-Dist: deepmerge; extra == "all"
214
+ Requires-Dist: openai; extra == "all"
215
+ Requires-Dist: sentence_transformers; extra == "all"
216
+ Requires-Dist: httpx_retries; extra == "all"
217
+ Requires-Dist: flet-webview; extra == "all"
216
218
  Requires-Dist: pymupdf; extra == "all"
217
- Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
218
- Requires-Dist: setuptools; extra == "all"
219
219
  Dynamic: author
220
220
  Dynamic: author-email
221
221
  Dynamic: description
@@ -1,4 +1,4 @@
1
- fmtr/tools/__init__.py,sha256=MwGzpdPZJq-ts-KVcq3tTnHlqLUEDEdbt_xD2Dq5Mmw,6125
1
+ fmtr/tools/__init__.py,sha256=Qh3jGKdC3MMZd7vQvIlrhZ0U7oTcTpBueX39VZwxX4U,5952
2
2
  fmtr/tools/api_tools.py,sha256=RyZUlTefSQozfl-8feZGauyUkwcFd-jU0KtKHFxHea4,2272
3
3
  fmtr/tools/async_tools.py,sha256=ewz757WcveQJd-G5SVr2JDOQVbdLGecCgl-tsBGVZz4,284
4
4
  fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCBej0,55
@@ -10,7 +10,6 @@ fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU
10
10
  fmtr/tools/datatype_tools.py,sha256=3P4AWIFGkJ-UqvXlj0Jc9IvkIIgTOE9jRrOk3NVbpH8,1508
11
11
  fmtr/tools/datetime_tools.py,sha256=StliYw51ZXi-miVB4O9Ps0zI6wsT_nbWhIb6R2ybNuo,330
12
12
  fmtr/tools/debugging_tools.py,sha256=_xzqS0V5BpL8d06j-jVQjGgI7T020QsqVXKAKMz7Du8,2082
13
- fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
14
13
  fmtr/tools/environment_tools.py,sha256=43uqfj1G1bNX0IwKz-NKbu3AbFYSdbBuGN9rlThe030,1845
15
14
  fmtr/tools/function_tools.py,sha256=O1K8HwftXfzrBblNZrj-BhWNbr4poJghrXNr2mFcylI,2831
16
15
  fmtr/tools/google_api_tools.py,sha256=QUungBoj5SCaBQnMjn9QpXtWmdNCplbw8ZPK9LXi77U,1691
@@ -46,7 +45,7 @@ fmtr/tools/tabular_tools.py,sha256=mw6vOij1Ch-pVAyHMPtm5zj__ULZN_TKeBYOfj33wFM,1
46
45
  fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
47
46
  fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
48
47
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
49
- fmtr/tools/version,sha256=H5VB8s4ADhl0W048HjCfuXefF06oOfGfyQBDNfQ1N9A,6
48
+ fmtr/tools/version,sha256=e7sG0pzqTEZCFyq-p4XV7ZnrBdiNXOVK9wniHT6cbaA,6
50
49
  fmtr/tools/webhook_tools.py,sha256=q3pVJ1NCem2SrMuFcLxiWd7DibFs7Q-uGtojfXd3Qcg,380
51
50
  fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
52
51
  fmtr/tools/ai_tools/__init__.py,sha256=O8VRlPnnQCncg2ZZ2l_VdWLJf4jkKH6dkZFVbv6o7IM,388
@@ -59,6 +58,7 @@ fmtr/tools/dns_tools/client.py,sha256=IBbd7Xgx9ExTn_EPoL7ts9JfXokHHuOiD9m4K6tl1Q
59
58
  fmtr/tools/dns_tools/dm.py,sha256=Lp1HaF7rpVtL_Ji4Bd32B29105H9ZKQ8AcVj_AB7nsA,6678
60
59
  fmtr/tools/dns_tools/proxy.py,sha256=gCWfH1pyWjj8xnJ8Pm4id7bsBWqcar3dQ9PeP5XjRXY,1624
61
60
  fmtr/tools/dns_tools/server.py,sha256=_Y5w5bGHhBI32fYWl-SmnOALAw_eF9fEbmrOqqgzSq8,4263
61
+ fmtr/tools/docker_tools/__init__.py,sha256=yEw5v6aqA_PSiEu7uTvq2DhXiZ2DmA9LqV4R7qAxI_4,220
62
62
  fmtr/tools/entrypoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  fmtr/tools/entrypoints/cache_hfh.py,sha256=fQNs4J9twQuZH_Yj98-oOvEX7-LrSUP3kO8nzw2HrHs,60
64
64
  fmtr/tools/entrypoints/ep_test.py,sha256=B8HfWISfSgw_xVX475CbJGh_QnpOe9MH65H8qGjTWbY,46
@@ -85,9 +85,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
85
85
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
86
86
  fmtr/tools/version_tools/__init__.py,sha256=cjE6nO6AoVOUp3RwgTbqL9wiw8J1l2pHJOz6Gn6bxjA,326
87
87
  fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
88
- fmtr_tools-1.3.53.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
89
- fmtr_tools-1.3.53.dist-info/METADATA,sha256=7DVDWk_gdIXyusS908pwRl2UkqSuNSPkfcZWlFjPcNo,17429
90
- fmtr_tools-1.3.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
- fmtr_tools-1.3.53.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
92
- fmtr_tools-1.3.53.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
93
- fmtr_tools-1.3.53.dist-info/RECORD,,
88
+ fmtr_tools-1.3.54.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
89
+ fmtr_tools-1.3.54.dist-info/METADATA,sha256=nDQPMFGoVatq6bJ8vS-uIKTVV9fgQA5zwQHhUuO9uWw,17455
90
+ fmtr_tools-1.3.54.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ fmtr_tools-1.3.54.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
92
+ fmtr_tools-1.3.54.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
93
+ fmtr_tools-1.3.54.dist-info/RECORD,,
@@ -1,30 +0,0 @@
1
- import contextlib
2
- import docker
3
-
4
-
5
- @contextlib.contextmanager
6
- def Container(image, ports=None, name=None, **kwargs):
7
- """
8
-
9
- Run a Docker container in a context manager
10
-
11
- """
12
- client = docker.from_env()
13
-
14
- try:
15
- container = client.containers.get(name)
16
- container.stop()
17
- container.remove()
18
- except docker.errors.NotFound:
19
- pass
20
-
21
- ports = {f'{port}/tcp': port for port in ports}
22
- container = client.containers.run(image, ports=ports, detach=True, name=name, **kwargs)
23
-
24
- try:
25
- yield container
26
- finally:
27
- container.stop()
28
- container.remove()
29
-
30
-