fmtr.tools 1.3.42__py3-none-any.whl → 1.3.43__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
@@ -1,4 +1,5 @@
1
1
  import fmtr.tools.async_tools as asyncio
2
+ import fmtr.tools.database_tools as db
2
3
  import fmtr.tools.dataclass_tools as dataclass
3
4
  import fmtr.tools.datatype_tools as datatype
4
5
  import fmtr.tools.environment_tools as env
fmtr/tools/constants.py CHANGED
@@ -32,7 +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/'
35
+ FMTR_DEV_HOST = 'ws.gex.fmtr.dev'
36
+ FMTR_DEV_INTERFACE_URL = F'https://{FMTR_DEV_HOST}/'
36
37
 
37
38
  FILENAME_CONFIG = 'settings.yaml'
38
39
  DIR_NAME_REPO = 'repo'
@@ -0,0 +1,6 @@
1
+ from fmtr.tools.import_tools import MissingExtraMockModule
2
+
3
+ try:
4
+ from fmtr.tools.database_tools import document
5
+ except ModuleNotFoundError as exception:
6
+ document = MissingExtraMockModule('db.document', exception)
@@ -0,0 +1,33 @@
1
+ import beanie
2
+ from functools import cached_property
3
+ from motor.motor_asyncio import AsyncIOMotorClient
4
+ from typing import List
5
+
6
+ from fmtr.tools.constants import Constants
7
+
8
+
9
+ class Document(beanie.Document):
10
+ """
11
+
12
+ Document stub.
13
+
14
+ """
15
+
16
+
17
+ class Client:
18
+
19
+ def __init__(self, name, host=Constants.FMTR_DEV_HOST, port=27017, documents: List[beanie.Document] | None = None):
20
+ self.name = name
21
+ self.host = host
22
+ self.port = port
23
+ self.documents = documents
24
+
25
+ self.client = AsyncIOMotorClient(self.uri)
26
+ self.db = self.client[self.name]
27
+
28
+ @cached_property
29
+ def uri(self):
30
+ return f'mongodb://{self.host}:{self.port}'
31
+
32
+ async def connect(self):
33
+ return await beanie.init_beanie(database=self.db, document_models=self.documents)
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.42
1
+ 1.3.43
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.42
3
+ Version: 1.3.43
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
@@ -131,63 +131,69 @@ Requires-Dist: logfire; extra == "webhook"
131
131
  Requires-Dist: logfire[httpx]; extra == "webhook"
132
132
  Provides-Extra: browsers
133
133
  Requires-Dist: playwright; extra == "browsers"
134
+ Provides-Extra: db
135
+ Provides-Extra: db-document
136
+ Requires-Dist: beanie[odm]; extra == "db-document"
137
+ Requires-Dist: motor; extra == "db-document"
134
138
  Provides-Extra: all
135
- Requires-Dist: transformers[sentencepiece]; extra == "all"
136
- Requires-Dist: flet-video; extra == "all"
137
- Requires-Dist: torchvision; extra == "all"
138
- Requires-Dist: docker; extra == "all"
139
- Requires-Dist: deepmerge; extra == "all"
140
- Requires-Dist: flet-webview; extra == "all"
141
- Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
142
- Requires-Dist: logfire[fastapi]; extra == "all"
143
139
  Requires-Dist: httpx; extra == "all"
144
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
145
- Requires-Dist: tabulate; extra == "all"
146
- Requires-Dist: filetype; extra == "all"
147
- Requires-Dist: pymupdf; extra == "all"
148
- Requires-Dist: playwright; extra == "all"
149
- Requires-Dist: google-api-python-client; extra == "all"
150
- Requires-Dist: huggingface_hub; extra == "all"
151
- Requires-Dist: tinynetrc; extra == "all"
140
+ Requires-Dist: dnspython[doh]; extra == "all"
141
+ Requires-Dist: pydantic-settings; extra == "all"
142
+ Requires-Dist: transformers[sentencepiece]; extra == "all"
152
143
  Requires-Dist: uvicorn[standard]; extra == "all"
153
- Requires-Dist: html2text; extra == "all"
144
+ Requires-Dist: bokeh; extra == "all"
145
+ Requires-Dist: faker; extra == "all"
146
+ Requires-Dist: ollama; extra == "all"
147
+ Requires-Dist: diskcache; extra == "all"
148
+ Requires-Dist: sre_yield; extra == "all"
149
+ Requires-Dist: motor; extra == "all"
150
+ Requires-Dist: cachetools; extra == "all"
151
+ Requires-Dist: tinynetrc; extra == "all"
154
152
  Requires-Dist: distributed; extra == "all"
155
- Requires-Dist: contexttimer; extra == "all"
156
- Requires-Dist: pydantic-settings; extra == "all"
157
- Requires-Dist: appdirs; extra == "all"
158
- Requires-Dist: json_repair; extra == "all"
153
+ Requires-Dist: logfire[fastapi]; extra == "all"
154
+ Requires-Dist: httpx_retries; extra == "all"
155
+ Requires-Dist: playwright; extra == "all"
156
+ Requires-Dist: flet-webview; extra == "all"
159
157
  Requires-Dist: torchaudio; extra == "all"
160
158
  Requires-Dist: openai; extra == "all"
161
- Requires-Dist: httpx_retries; extra == "all"
162
- Requires-Dist: setuptools; extra == "all"
163
- Requires-Dist: sentence_transformers; extra == "all"
164
- Requires-Dist: sre_yield; extra == "all"
165
- Requires-Dist: ollama; extra == "all"
159
+ Requires-Dist: google-auth-oauthlib; extra == "all"
160
+ Requires-Dist: html2text; extra == "all"
161
+ Requires-Dist: openpyxl; extra == "all"
162
+ Requires-Dist: regex; extra == "all"
163
+ Requires-Dist: json_repair; extra == "all"
166
164
  Requires-Dist: pyyaml; extra == "all"
167
- Requires-Dist: google-auth; extra == "all"
165
+ Requires-Dist: google-auth-httplib2; extra == "all"
166
+ Requires-Dist: logfire; extra == "all"
167
+ Requires-Dist: contexttimer; extra == "all"
168
168
  Requires-Dist: pytest-cov; extra == "all"
169
- Requires-Dist: dask[bag]; extra == "all"
169
+ Requires-Dist: docker; extra == "all"
170
170
  Requires-Dist: flet[all]; extra == "all"
171
- Requires-Dist: cachetools; extra == "all"
172
- Requires-Dist: peft; extra == "all"
173
- Requires-Dist: dnspython[doh]; extra == "all"
174
- Requires-Dist: diskcache; extra == "all"
171
+ Requires-Dist: huggingface_hub; extra == "all"
175
172
  Requires-Dist: pymupdf4llm; extra == "all"
176
- Requires-Dist: pandas; extra == "all"
177
- Requires-Dist: google-auth-oauthlib; extra == "all"
173
+ Requires-Dist: setuptools; extra == "all"
174
+ Requires-Dist: beanie[odm]; extra == "all"
175
+ Requires-Dist: Unidecode; extra == "all"
176
+ Requires-Dist: dask[bag]; extra == "all"
178
177
  Requires-Dist: pydantic; extra == "all"
179
- Requires-Dist: openpyxl; extra == "all"
180
- Requires-Dist: bokeh; extra == "all"
181
- Requires-Dist: semver; extra == "all"
178
+ Requires-Dist: sentence_transformers; extra == "all"
179
+ Requires-Dist: peft; extra == "all"
180
+ Requires-Dist: flet-video; extra == "all"
181
+ Requires-Dist: torchvision; extra == "all"
182
+ Requires-Dist: fastapi; extra == "all"
183
+ Requires-Dist: google-api-python-client; extra == "all"
184
+ Requires-Dist: tabulate; extra == "all"
182
185
  Requires-Dist: logfire[httpx]; extra == "all"
183
- Requires-Dist: logfire; extra == "all"
184
- Requires-Dist: regex; extra == "all"
185
- Requires-Dist: google-auth-httplib2; extra == "all"
186
+ Requires-Dist: deepmerge; extra == "all"
186
187
  Requires-Dist: yamlscript; extra == "all"
187
- Requires-Dist: fastapi; extra == "all"
188
- Requires-Dist: faker; extra == "all"
189
- Requires-Dist: Unidecode; extra == "all"
190
188
  Requires-Dist: tokenizers; extra == "all"
189
+ Requires-Dist: semver; extra == "all"
190
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
191
+ Requires-Dist: filetype; extra == "all"
192
+ Requires-Dist: appdirs; extra == "all"
193
+ Requires-Dist: pandas; extra == "all"
194
+ Requires-Dist: pymupdf; extra == "all"
195
+ Requires-Dist: google-auth; extra == "all"
196
+ Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
191
197
  Dynamic: author
192
198
  Dynamic: author-email
193
199
  Dynamic: description
@@ -1,9 +1,9 @@
1
- fmtr/tools/__init__.py,sha256=BgPmMHsTj2YQcca30H54X2EHhCV7eLO0m6AudLAzFHg,6086
1
+ fmtr/tools/__init__.py,sha256=MwGzpdPZJq-ts-KVcq3tTnHlqLUEDEdbt_xD2Dq5Mmw,6125
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
5
5
  fmtr/tools/caching_tools.py,sha256=74p7m2GLFfeP41LX69wxgfkilxEAoWkMIfFMjKsYpyg,4976
6
- fmtr/tools/constants.py,sha256=idsZZ_IBkWFZusrv0_0YM0_yHM92_jqiFhfTz-GYkBg,1698
6
+ fmtr/tools/constants.py,sha256=-sx8cWeJDT92abFGdiuGBpHktVCTzZcgZKkJbKTSBTg,1737
7
7
  fmtr/tools/context_tools.py,sha256=4UvIHYgLqAh7dXMX9EBrLEpYp81qfzhSVrkffOSAoGA,350
8
8
  fmtr/tools/data_modelling_tools.py,sha256=0BFm-F_cYzVTxftWQwORkPd0FM2BTLVh9-s0-rTTFoo,1744
9
9
  fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
@@ -46,12 +46,14 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,1
46
46
  fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
47
47
  fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
48
48
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
49
- fmtr/tools/version,sha256=TDaNjG0EZ_-NmyTu69UoZ8BVNXDmodq2PlyqxBZPSR8,6
49
+ fmtr/tools/version,sha256=PAm8DHeBkkGOhkI26lJMzFsO3J1asLOJFNQ9wSee99I,6
50
50
  fmtr/tools/webhook_tools.py,sha256=q3pVJ1NCem2SrMuFcLxiWd7DibFs7Q-uGtojfXd3Qcg,380
51
51
  fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
52
52
  fmtr/tools/ai_tools/__init__.py,sha256=O8VRlPnnQCncg2ZZ2l_VdWLJf4jkKH6dkZFVbv6o7IM,388
53
53
  fmtr/tools/ai_tools/agentic_tools.py,sha256=-6q9Cp8WUbLu9AmS5SI5R8qtWMp1Ky4rFXMtfLvcQ7A,4791
54
54
  fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
55
+ fmtr/tools/database_tools/__init__.py,sha256=-YXEs3P4nwg7hdvALpaW4K2Pg9FIc49rD53smqnBgT4,221
56
+ fmtr/tools/database_tools/document.py,sha256=HPNbINknXDa4PwbNm5KzPxMOcnuqTtWbQWU_eXNohKQ,796
55
57
  fmtr/tools/dns_tools/__init__.py,sha256=HP0Qcwyi1C6vBH_ejuWrGJOWdp-GZ_cmH-QofjD6Mmg,266
56
58
  fmtr/tools/dns_tools/client.py,sha256=IBbd7Xgx9ExTn_EPoL7ts9JfXokHHuOiD9m4K6tl1Q0,2817
57
59
  fmtr/tools/dns_tools/dm.py,sha256=Lp1HaF7rpVtL_Ji4Bd32B29105H9ZKQ8AcVj_AB7nsA,6678
@@ -83,9 +85,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
83
85
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
84
86
  fmtr/tools/version_tools/__init__.py,sha256=cjE6nO6AoVOUp3RwgTbqL9wiw8J1l2pHJOz6Gn6bxjA,326
85
87
  fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
86
- fmtr_tools-1.3.42.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
87
- fmtr_tools-1.3.42.dist-info/METADATA,sha256=tcC-acF32LrI5HsNdj-gpQRHPD24E4tWEhU-1pgpuNo,16213
88
- fmtr_tools-1.3.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
89
- fmtr_tools-1.3.42.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
90
- fmtr_tools-1.3.42.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
91
- fmtr_tools-1.3.42.dist-info/RECORD,,
88
+ fmtr_tools-1.3.43.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
89
+ fmtr_tools-1.3.43.dist-info/METADATA,sha256=jkIsBm9iBuDTZGWvxInOEydSzNLl1Cova7qjNRzXWuA,16436
90
+ fmtr_tools-1.3.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ fmtr_tools-1.3.43.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
92
+ fmtr_tools-1.3.43.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
93
+ fmtr_tools-1.3.43.dist-info/RECORD,,