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

@@ -1,8 +1,9 @@
1
- import beanie
2
1
  from functools import cached_property
3
- from motor.motor_asyncio import AsyncIOMotorClient
4
2
  from typing import List
5
3
 
4
+ import beanie
5
+ from motor.motor_asyncio import AsyncIOMotorClient
6
+
6
7
  from fmtr.tools.constants import Constants
7
8
 
8
9
 
@@ -22,7 +23,7 @@ class Client:
22
23
  self.port = port
23
24
  self.documents = documents
24
25
 
25
- self.client = AsyncIOMotorClient(self.uri)
26
+ self.client = AsyncIOMotorClient(self.uri, tz_aware=True)
26
27
  self.db = self.client[self.name]
27
28
 
28
29
  @cached_property
@@ -1,5 +1,31 @@
1
1
  from datetime import datetime, timezone
2
+ from functools import lru_cache
2
3
 
3
4
 
4
- def now():
5
+ def now() -> datetime:
6
+ """
7
+
8
+ Now UTC
9
+
10
+ """
5
11
  return datetime.now(tz=timezone.utc)
12
+
13
+
14
+ @lru_cache
15
+ def min() -> datetime:
16
+ """
17
+
18
+ Min UTC
19
+
20
+ """
21
+ return now().min
22
+
23
+
24
+ @lru_cache
25
+ def max():
26
+ """
27
+
28
+ Max UTC
29
+
30
+ """
31
+ return now().max
@@ -14,6 +14,14 @@ IS_DEBUG = environment_tools.get(Constants.FMTR_LOG_LEVEL_KEY, None, converter=s
14
14
  LEVEL_DEFAULT = logging.DEBUG if IS_DEBUG else logging.INFO
15
15
 
16
16
 
17
+ def null_scrubber(match):
18
+ """
19
+
20
+ Effectively disable scrubbing
21
+
22
+ """
23
+ return match.value
24
+
17
25
  def get_logger(name, version=None, host=Constants.FMTR_OBS_HOST, key=None, org=Constants.ORG_NAME,
18
26
  stream=STREAM_DEFAULT, environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
19
27
  """
@@ -64,7 +72,8 @@ def get_logger(name, version=None, host=Constants.FMTR_OBS_HOST, key=None, org=C
64
72
  service_version=version,
65
73
  environment=environment,
66
74
  send_to_logfire=False,
67
- console=console_opts
75
+ console=console_opts,
76
+ scrubbing=logfire.ScrubbingOptions(callback=null_scrubber)
68
77
  )
69
78
 
70
79
  if key is None:
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.49
1
+ 1.3.51
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.49
3
+ Version: 1.3.51
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
@@ -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: pydantic-ai[logfire,openai]; extra == "all"
158
- Requires-Dist: torchaudio; extra == "all"
157
+ Requires-Dist: Unidecode; extra == "all"
158
+ Requires-Dist: deepdiff; extra == "all"
159
+ Requires-Dist: peft; extra == "all"
160
+ Requires-Dist: flet[all]; extra == "all"
161
+ Requires-Dist: pandas; extra == "all"
162
+ Requires-Dist: logfire[httpx]; extra == "all"
163
+ Requires-Dist: playwright; extra == "all"
159
164
  Requires-Dist: odfpy; extra == "all"
160
- Requires-Dist: pymupdf; extra == "all"
161
- Requires-Dist: distributed; extra == "all"
162
- Requires-Dist: json_repair; extra == "all"
163
165
  Requires-Dist: bokeh; extra == "all"
164
166
  Requires-Dist: tinynetrc; extra == "all"
167
+ Requires-Dist: logfire; extra == "all"
168
+ Requires-Dist: pydantic-settings; extra == "all"
169
+ Requires-Dist: ollama; extra == "all"
165
170
  Requires-Dist: fastapi; extra == "all"
166
- Requires-Dist: pycountry; extra == "all"
171
+ Requires-Dist: uvicorn[standard]; extra == "all"
172
+ Requires-Dist: transformers[sentencepiece]; extra == "all"
173
+ Requires-Dist: distributed; extra == "all"
174
+ Requires-Dist: beanie[odm]; extra == "all"
175
+ Requires-Dist: flet-webview; extra == "all"
167
176
  Requires-Dist: sre_yield; extra == "all"
168
- Requires-Dist: semver; extra == "all"
169
- Requires-Dist: html2text; extra == "all"
170
- Requires-Dist: pytest-cov; extra == "all"
171
- Requires-Dist: pyyaml; extra == "all"
177
+ Requires-Dist: google-api-python-client; extra == "all"
178
+ Requires-Dist: contexttimer; extra == "all"
172
179
  Requires-Dist: appdirs; extra == "all"
173
- Requires-Dist: pydantic; extra == "all"
174
- Requires-Dist: httpx_retries; extra == "all"
175
- Requires-Dist: ollama; extra == "all"
176
- Requires-Dist: pandas; extra == "all"
177
- Requires-Dist: pydantic-extra-types; extra == "all"
178
- Requires-Dist: google-auth; extra == "all"
179
- Requires-Dist: dask[bag]; extra == "all"
180
- Requires-Dist: uvicorn[standard]; extra == "all"
181
- Requires-Dist: httpx; extra == "all"
182
- Requires-Dist: pydantic-settings; extra == "all"
183
- Requires-Dist: sentence_transformers; extra == "all"
180
+ Requires-Dist: yamlscript; extra == "all"
181
+ Requires-Dist: motor; extra == "all"
184
182
  Requires-Dist: tokenizers; extra == "all"
185
- Requires-Dist: deepdiff; extra == "all"
183
+ Requires-Dist: cachetools; extra == "all"
184
+ Requires-Dist: semver; extra == "all"
185
+ Requires-Dist: torchaudio; extra == "all"
186
186
  Requires-Dist: diskcache; extra == "all"
187
- Requires-Dist: faker; extra == "all"
188
- Requires-Dist: playwright; extra == "all"
189
- Requires-Dist: contexttimer; extra == "all"
190
- Requires-Dist: google-api-python-client; extra == "all"
191
- Requires-Dist: filetype; extra == "all"
192
- Requires-Dist: motor; extra == "all"
193
- Requires-Dist: deepmerge; extra == "all"
194
- Requires-Dist: peft; extra == "all"
195
- Requires-Dist: yamlscript; extra == "all"
196
- Requires-Dist: transformers[sentencepiece]; extra == "all"
197
- Requires-Dist: google-auth-oauthlib; extra == "all"
198
- Requires-Dist: pymupdf4llm; extra == "all"
187
+ Requires-Dist: regex; extra == "all"
188
+ Requires-Dist: dask[bag]; extra == "all"
189
+ Requires-Dist: openpyxl; extra == "all"
190
+ Requires-Dist: pyyaml; extra == "all"
199
191
  Requires-Dist: setuptools; extra == "all"
192
+ Requires-Dist: google-auth-oauthlib; extra == "all"
193
+ Requires-Dist: openai; extra == "all"
194
+ Requires-Dist: google-auth-httplib2; extra == "all"
195
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
196
+ Requires-Dist: pycountry; extra == "all"
200
197
  Requires-Dist: tabulate; extra == "all"
201
- Requires-Dist: logfire; extra == "all"
202
- Requires-Dist: beanie[odm]; extra == "all"
203
- Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
204
198
  Requires-Dist: flet-video; extra == "all"
205
- Requires-Dist: logfire[httpx]; extra == "all"
206
- Requires-Dist: regex; extra == "all"
207
- Requires-Dist: openai; extra == "all"
199
+ Requires-Dist: pydantic; extra == "all"
208
200
  Requires-Dist: docker; extra == "all"
201
+ Requires-Dist: html2text; extra == "all"
202
+ Requires-Dist: logfire[fastapi]; extra == "all"
203
+ Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
204
+ Requires-Dist: faker; extra == "all"
205
+ Requires-Dist: httpx_retries; extra == "all"
206
+ Requires-Dist: pytest-cov; extra == "all"
207
+ Requires-Dist: pymupdf; extra == "all"
209
208
  Requires-Dist: huggingface_hub; extra == "all"
210
209
  Requires-Dist: dnspython[doh]; extra == "all"
211
- Requires-Dist: google-auth-httplib2; extra == "all"
212
- Requires-Dist: Unidecode; extra == "all"
213
- Requires-Dist: logfire[fastapi]; extra == "all"
214
- Requires-Dist: openpyxl; extra == "all"
210
+ Requires-Dist: httpx; extra == "all"
211
+ Requires-Dist: google-auth; extra == "all"
212
+ Requires-Dist: sentence_transformers; extra == "all"
213
+ Requires-Dist: deepmerge; extra == "all"
214
+ Requires-Dist: pydantic-extra-types; extra == "all"
215
+ Requires-Dist: filetype; extra == "all"
215
216
  Requires-Dist: torchvision; extra == "all"
216
- Requires-Dist: cachetools; extra == "all"
217
- Requires-Dist: flet-webview; extra == "all"
218
- Requires-Dist: flet[all]; extra == "all"
217
+ Requires-Dist: pymupdf4llm; extra == "all"
218
+ Requires-Dist: json_repair; extra == "all"
219
219
  Dynamic: author
220
220
  Dynamic: author-email
221
221
  Dynamic: description
@@ -8,7 +8,7 @@ fmtr/tools/context_tools.py,sha256=4UvIHYgLqAh7dXMX9EBrLEpYp81qfzhSVrkffOSAoGA,3
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
10
10
  fmtr/tools/datatype_tools.py,sha256=3P4AWIFGkJ-UqvXlj0Jc9IvkIIgTOE9jRrOk3NVbpH8,1508
11
- fmtr/tools/datetime_tools.py,sha256=BfQCk5O5MbMEGF-TUsNTRKD8fJ6GJr3t92XKwRna2vk,94
11
+ fmtr/tools/datetime_tools.py,sha256=StliYw51ZXi-miVB4O9Ps0zI6wsT_nbWhIb6R2ybNuo,330
12
12
  fmtr/tools/debugging_tools.py,sha256=_xzqS0V5BpL8d06j-jVQjGgI7T020QsqVXKAKMz7Du8,2082
13
13
  fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
14
14
  fmtr/tools/environment_tools.py,sha256=43uqfj1G1bNX0IwKz-NKbu3AbFYSdbBuGN9rlThe030,1845
@@ -24,7 +24,7 @@ fmtr/tools/inspection_tools.py,sha256=tLTRvzy9XVomQPi0dfnF_cgwc7KiDVZAr7gPTk4S_b
24
24
  fmtr/tools/iterator_tools.py,sha256=ymxo2U9MrPhouIhWCVvh1TrP1bXJPm_p0Lqwgi5Jr6w,1628
25
25
  fmtr/tools/json_fix_tools.py,sha256=vNSlswVQnujPmKEqDjFJcO901mjMyv59q3awsT7mlhs,477
26
26
  fmtr/tools/json_tools.py,sha256=WkFc5q7oqMtcFejhN1K5zQFULa9TdLOup83Fr0saDRY,348
27
- fmtr/tools/logging_tools.py,sha256=M7I5igs_tX5SIRv4f-jfb75LOODclSdmEg5ziAAMSPE,2503
27
+ fmtr/tools/logging_tools.py,sha256=jZFKnL-7HHOaPkn7F3fT9DyffIgwY-g7SEQ0p1RhzBo,2673
28
28
  fmtr/tools/merging_tools.py,sha256=KDxCEFJEQJEwGw1qGKAgR55uUE2X2S5NWLKcfHRmX_k,227
29
29
  fmtr/tools/metric_tools.py,sha256=Lvia5CGFRIfrDFA8s37btIfTU5zHbo04cPJdAMtbndQ,272
30
30
  fmtr/tools/name_tools.py,sha256=5CB_phqhHjl66iI8oLxOGPF2odC1apdul-M8Fv2xBhs,5514
@@ -46,14 +46,14 @@ fmtr/tools/tabular_tools.py,sha256=mw6vOij1Ch-pVAyHMPtm5zj__ULZN_TKeBYOfj33wFM,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=Gu0FxrnxSfSiaBEXNfjNzhDJ5oAjWBiF3qy9XGVZUJU,6
49
+ fmtr/tools/version,sha256=NVeTYfBvMTN0J69eaRYiRCXF4MfMOA8PxBnn8ZHiogg,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=aLejbLSmftXQpxnt1Kgia9UcCmj108U1pqOiAUI6l_I,4939
54
54
  fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
55
55
  fmtr/tools/database_tools/__init__.py,sha256=-YXEs3P4nwg7hdvALpaW4K2Pg9FIc49rD53smqnBgT4,221
56
- fmtr/tools/database_tools/document.py,sha256=HPNbINknXDa4PwbNm5KzPxMOcnuqTtWbQWU_eXNohKQ,796
56
+ fmtr/tools/database_tools/document.py,sha256=QLW-Ll2uVp1UTjA4leiJ3gtrUJHQPzwpFT_AZ3jow3A,812
57
57
  fmtr/tools/dns_tools/__init__.py,sha256=HP0Qcwyi1C6vBH_ejuWrGJOWdp-GZ_cmH-QofjD6Mmg,266
58
58
  fmtr/tools/dns_tools/client.py,sha256=IBbd7Xgx9ExTn_EPoL7ts9JfXokHHuOiD9m4K6tl1Q0,2817
59
59
  fmtr/tools/dns_tools/dm.py,sha256=Lp1HaF7rpVtL_Ji4Bd32B29105H9ZKQ8AcVj_AB7nsA,6678
@@ -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.49.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
89
- fmtr_tools-1.3.49.dist-info/METADATA,sha256=1oejOVboa3Ol_fXNcxIa3WG49h9fMV8G8YgRWGqeJJo,17429
90
- fmtr_tools-1.3.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
- fmtr_tools-1.3.49.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
92
- fmtr_tools-1.3.49.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
93
- fmtr_tools-1.3.49.dist-info/RECORD,,
88
+ fmtr_tools-1.3.51.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
89
+ fmtr_tools-1.3.51.dist-info/METADATA,sha256=CM1ZEstQVxxg8jbZD_7xYjx9fCmcX5sd0gM-zmsCXRM,17429
90
+ fmtr_tools-1.3.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ fmtr_tools-1.3.51.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
92
+ fmtr_tools-1.3.51.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
93
+ fmtr_tools-1.3.51.dist-info/RECORD,,