fmtr.tools 1.1.6__py3-none-any.whl → 1.1.8__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/constants.py CHANGED
@@ -29,6 +29,9 @@ class Constants:
29
29
  FMTR_AI_HOST_DEFAULT = 'ai.gex.fmtr.dev'
30
30
 
31
31
  FILENAME_CONFIG = 'settings.yaml'
32
- DIR_NAME_ARTIFACTS = 'artifacts'
32
+ DIR_NAME_REPO = 'repo'
33
+ DIR_NAME_DATA = 'data'
34
+ DIR_NAME_ARTIFACT = 'artifact'
35
+ DIR_NAME_SOURCE = 'source'
33
36
  FILENAME_VERSION = 'version'
34
37
  DIR_NAME_HF = 'hf'
@@ -74,6 +74,7 @@ def debug_shell():
74
74
  and enabling tracing with debug mode turned on.
75
75
 
76
76
  """
77
+ import sys
77
78
  path_str = sys.argv[1]
78
79
  data = ShellDebug.from_path(path_str)
79
80
  trace(is_debug=True)
fmtr/tools/path_tools.py CHANGED
@@ -145,6 +145,15 @@ class Path(type(Path())):
145
145
  """
146
146
  return self.mkdir(parents=True, exist_ok=True)
147
147
 
148
+ @property
149
+ def exist(self):
150
+ """
151
+
152
+ Exists as property
153
+
154
+ """
155
+ return super().exists()
156
+
148
157
 
149
158
  class PackagePaths:
150
159
  """
@@ -153,7 +162,10 @@ class PackagePaths:
153
162
 
154
163
  """
155
164
 
156
- def __init__(self, path=None, org_singleton=None, dir_name_artifacts=Constants.DIR_NAME_ARTIFACTS, filename_config=Constants.FILENAME_CONFIG, file_version=Constants.FILENAME_VERSION):
165
+ dev = Path('/') / 'opt' / 'dev'
166
+ data_global = dev / Constants.DIR_NAME_DATA
167
+
168
+ def __init__(self, path=None, org_singleton=None, dir_name_data=Constants.DIR_NAME_DATA, filename_config=Constants.FILENAME_CONFIG, file_version=Constants.FILENAME_VERSION):
157
169
 
158
170
  """
159
171
 
@@ -166,10 +178,19 @@ class PackagePaths:
166
178
 
167
179
  self.path = Path(path)
168
180
  self.org_singleton = org_singleton
169
- self.dir_name_artifacts = dir_name_artifacts
181
+ self.dir_name_data = dir_name_data
170
182
  self.filename_config = filename_config
171
183
  self.filename_version = file_version
172
184
 
185
+ @property
186
+ def is_dev(self) -> bool:
187
+ """
188
+
189
+ Is the package in the dev directory - as opposed to `site-packages` etc?
190
+
191
+ """
192
+ return self.path.is_relative_to(self.dev)
193
+
173
194
  @property
174
195
  def is_namespace(self) -> bool:
175
196
  """
@@ -188,6 +209,19 @@ class PackagePaths:
188
209
  """
189
210
  return self.path.stem
190
211
 
212
+ @property
213
+ def name_ns(self) -> str:
214
+ """
215
+
216
+ Name of namespace package.
217
+
218
+ """
219
+
220
+ if self.is_namespace:
221
+ return f'{self.org}.{self.name}'
222
+ else:
223
+ return self.name
224
+
191
225
  @property
192
226
  def org(self) -> str:
193
227
  """
@@ -222,20 +256,36 @@ class PackagePaths:
222
256
  return self.path / self.filename_version
223
257
 
224
258
  @property
225
- def artifacts(self) -> Path:
259
+ def data(self) -> Path:
226
260
  """
227
261
 
228
- Path of artifacts directory.
262
+ Path of project-specific data directory.
229
263
 
230
264
  """
231
265
 
232
- from fmtr.tools import env
233
- if env.IS_DEBUG:
234
- path = self.repo / self.dir_name_artifacts
235
- else:
236
- path = Path('/') / self.dir_name_artifacts
266
+ return self.dev / Constants.DIR_NAME_REPO / self.name_ns / self.dir_name_data
267
+
268
+ @property
269
+ def artifact(self) -> Path:
270
+ """
271
+
272
+ Path of project-specific artifact directory
273
+
274
+ """
275
+
276
+ return self.data / Constants.DIR_NAME_ARTIFACT
277
+
278
+ @property
279
+ def source(self) -> Path:
280
+ """
281
+
282
+ Path of project-specific source directory
283
+
284
+ """
285
+
286
+ return self.data / Constants.DIR_NAME_SOURCE
287
+
237
288
 
238
- return path
239
289
 
240
290
  @property
241
291
  def settings(self) -> Path:
@@ -244,7 +294,7 @@ class PackagePaths:
244
294
  Path of settings file.
245
295
 
246
296
  """
247
- return self.artifacts / self.filename_config
297
+ return self.data / self.filename_config
248
298
 
249
299
  @property
250
300
  def hf(self) -> Path:
@@ -253,7 +303,7 @@ class PackagePaths:
253
303
  Path of HuggingFace directory
254
304
 
255
305
  """
256
- return self.artifacts / Constants.DIR_NAME_HF
306
+ return self.artifact / Constants.DIR_NAME_HF
257
307
 
258
308
  def __repr__(self) -> str:
259
309
  """
@@ -262,3 +312,8 @@ class PackagePaths:
262
312
 
263
313
  """
264
314
  return f'{self.__class__.__name__}("{self.path}")'
315
+
316
+
317
+ if __name__ == "__main__":
318
+ paths = PackagePaths()
319
+ paths
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.1.6
1
+ 1.1.8
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.1.6
3
+ Version: 1.1.8
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
@@ -9,51 +9,51 @@ License: Copyright © 2025 Frontmatter. All rights reserved.
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Provides-Extra: test
12
- Requires-Dist: google-api-python-client; extra == "test"
13
12
  Requires-Dist: pymupdf4llm; extra == "test"
14
- Requires-Dist: faker; extra == "test"
13
+ Requires-Dist: pydantic-settings; extra == "test"
14
+ Requires-Dist: tinynetrc; extra == "test"
15
+ Requires-Dist: torchvision; extra == "test"
15
16
  Requires-Dist: pyyaml; extra == "test"
16
- Requires-Dist: html2text; extra == "test"
17
+ Requires-Dist: openai; extra == "test"
18
+ Requires-Dist: flet-webview; extra == "test"
17
19
  Requires-Dist: pymupdf; extra == "test"
20
+ Requires-Dist: faker; extra == "test"
21
+ Requires-Dist: pydevd-pycharm; extra == "test"
22
+ Requires-Dist: distributed; extra == "test"
18
23
  Requires-Dist: contexttimer; extra == "test"
19
- Requires-Dist: dask[bag]; extra == "test"
20
- Requires-Dist: json_repair; extra == "test"
21
- Requires-Dist: torchvision; extra == "test"
22
- Requires-Dist: pydantic-settings; extra == "test"
23
- Requires-Dist: huggingface_hub; extra == "test"
24
- Requires-Dist: logfire[fastapi]; extra == "test"
25
- Requires-Dist: transformers[sentencepiece]; extra == "test"
26
- Requires-Dist: sre_yield; extra == "test"
27
- Requires-Dist: pytest-cov; extra == "test"
24
+ Requires-Dist: semver; extra == "test"
25
+ Requires-Dist: bokeh; extra == "test"
28
26
  Requires-Dist: torchaudio; extra == "test"
29
- Requires-Dist: sentence_transformers; extra == "test"
30
- Requires-Dist: pydantic; extra == "test"
27
+ Requires-Dist: huggingface_hub; extra == "test"
28
+ Requires-Dist: google-auth-oauthlib; extra == "test"
29
+ Requires-Dist: openpyxl; extra == "test"
31
30
  Requires-Dist: docker; extra == "test"
32
- Requires-Dist: tokenizers; extra == "test"
31
+ Requires-Dist: pytest-cov; extra == "test"
33
32
  Requires-Dist: uvicorn[standard]; extra == "test"
33
+ Requires-Dist: html2text; extra == "test"
34
+ Requires-Dist: google-api-python-client; extra == "test"
35
+ Requires-Dist: sentence_transformers; extra == "test"
36
+ Requires-Dist: logfire; extra == "test"
37
+ Requires-Dist: Unidecode; extra == "test"
38
+ Requires-Dist: diskcache; extra == "test"
39
+ Requires-Dist: flet[all]; extra == "test"
34
40
  Requires-Dist: pandas; extra == "test"
35
- Requires-Dist: openpyxl; extra == "test"
41
+ Requires-Dist: tokenizers; extra == "test"
42
+ Requires-Dist: fastapi; extra == "test"
43
+ Requires-Dist: peft; extra == "test"
44
+ Requires-Dist: json_repair; extra == "test"
45
+ Requires-Dist: google-auth; extra == "test"
46
+ Requires-Dist: transformers[sentencepiece]; extra == "test"
47
+ Requires-Dist: tabulate; extra == "test"
48
+ Requires-Dist: logfire[fastapi]; extra == "test"
36
49
  Requires-Dist: ollama; extra == "test"
37
50
  Requires-Dist: flet-video; extra == "test"
38
- Requires-Dist: flet-webview; extra == "test"
39
- Requires-Dist: pydevd-pycharm; extra == "test"
40
- Requires-Dist: google-auth; extra == "test"
41
- Requires-Dist: tinynetrc; extra == "test"
42
- Requires-Dist: google-auth-oauthlib; extra == "test"
43
51
  Requires-Dist: deepmerge; extra == "test"
44
- Requires-Dist: openai; extra == "test"
45
- Requires-Dist: diskcache; extra == "test"
46
- Requires-Dist: bokeh; extra == "test"
47
- Requires-Dist: logfire; extra == "test"
48
- Requires-Dist: google-auth-httplib2; extra == "test"
49
- Requires-Dist: semver; extra == "test"
50
- Requires-Dist: tabulate; extra == "test"
52
+ Requires-Dist: sre_yield; extra == "test"
53
+ Requires-Dist: pydantic; extra == "test"
51
54
  Requires-Dist: pydantic-ai[logfire,openai]; extra == "test"
52
- Requires-Dist: fastapi; extra == "test"
53
- Requires-Dist: Unidecode; extra == "test"
54
- Requires-Dist: distributed; extra == "test"
55
- Requires-Dist: peft; extra == "test"
56
- Requires-Dist: flet[all]; extra == "test"
55
+ Requires-Dist: dask[bag]; extra == "test"
56
+ Requires-Dist: google-auth-httplib2; extra == "test"
57
57
  Provides-Extra: yaml
58
58
  Requires-Dist: pyyaml; extra == "yaml"
59
59
  Provides-Extra: logging
@@ -4,11 +4,11 @@ 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=UOCYUNvLQ-NofR_dhqBmZF96-HRPf4At5MmxVk3gAIk,2943
6
6
  fmtr/tools/console_script_tools.py,sha256=7KVO0WI3Z7d7EZcmvTVS-O4OMxYYMZuA_7s0eubv76E,328
7
- fmtr/tools/constants.py,sha256=vc7sa1WdEsaxqSxrRAKTmNv8EmtOoY3b_V9CtAx4zzw,1125
7
+ fmtr/tools/constants.py,sha256=6RvZLlj0jrej0X7yz-03uu-ELSYWFGknjmb-iOcozm0,1208
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/debugging_tools.py,sha256=t3DGzdjiEVIYV2H_R620eAhyxgsEFsqwmZygmBEUt58,2067
11
+ fmtr/tools/debugging_tools.py,sha256=_xzqS0V5BpL8d06j-jVQjGgI7T020QsqVXKAKMz7Du8,2082
12
12
  fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
13
13
  fmtr/tools/environment_tools.py,sha256=ZO2e8pTzbQ8jNXnmKpaZF7_3qkVM6U5iqku5YSwOszE,1849
14
14
  fmtr/tools/function_tools.py,sha256=_oW3-HZXMst2pcU-I-U7KTMmzo0g9MIQKmX-c2_NEoE,858
@@ -29,7 +29,7 @@ fmtr/tools/name_tools.py,sha256=5CB_phqhHjl66iI8oLxOGPF2odC1apdul-M8Fv2xBhs,5514
29
29
  fmtr/tools/netrc_tools.py,sha256=PpNpz_mWlQi6VHGromKwFfTyLpHUXsd4LY6-OKLCbeI,376
30
30
  fmtr/tools/openai_tools.py,sha256=6SUgejgzUzmlKKct2_ePXntvMegu3FJgfk9x7aqtqYc,742
31
31
  fmtr/tools/parallel_tools.py,sha256=QEb_gN1StkxsqYaH4HSjiJX8Y3gpb2uKNsOzG4uFpaM,3071
32
- fmtr/tools/path_tools.py,sha256=UNi_qRBugDHxBNdEm26wHy3UUBOfY6fVK_G1P51RfCI,6175
32
+ fmtr/tools/path_tools.py,sha256=f4FOFhWdC5U1yeMtHPQatvXhs6cCTCC4RuPoLZo0kRE,7094
33
33
  fmtr/tools/pdf_tools.py,sha256=xvv9B84uAF81rFJRnXhSsxYuP42vY9ZdPVFrSMVe8G8,4069
34
34
  fmtr/tools/platform_tools.py,sha256=7p69CmAHe_sF68Fx9uVhns1k5EewTHTWgUYzkl6ZQKA,308
35
35
  fmtr/tools/process_tools.py,sha256=Ysh5Dk2QFBhXQerArjKdt7xZd3JrN5Ho02AaOjH0Nnw,1425
@@ -43,7 +43,7 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,1
43
43
  fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
44
44
  fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
45
45
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
46
- fmtr/tools/version,sha256=BNiWbHqtYm5lfiKfQRzKXTL2nBrnbwbpNUKsa17xLUc,5
46
+ fmtr/tools/version,sha256=mTnviWxfu32TdnriwXIi9L7V08GJiIKe9xvXj3QQt_k,5
47
47
  fmtr/tools/version_tools.py,sha256=yNs_CGqWpqE4jbK9wsPIi14peJVXYbhIcMqHAFOw3yE,1480
48
48
  fmtr/tools/yaml_tools.py,sha256=Ol43ZwbnSXGnn1K98Uxx61KPGSqfC4axE-X2q1LKMwk,349
49
49
  fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
@@ -57,9 +57,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
57
57
  fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
58
58
  fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
59
59
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
60
- fmtr_tools-1.1.6.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
61
- fmtr_tools-1.1.6.dist-info/METADATA,sha256=_tKE6fvUcfRKm2VIE4_JLrd5c8Tekz4LXzZJLWhsHOk,14646
62
- fmtr_tools-1.1.6.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
63
- fmtr_tools-1.1.6.dist-info/entry_points.txt,sha256=e-eOW1Ml13tbxHC6Er1MnVOEDePeWw7DKwlE-l-gCY0,205
64
- fmtr_tools-1.1.6.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
65
- fmtr_tools-1.1.6.dist-info/RECORD,,
60
+ fmtr_tools-1.1.8.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
61
+ fmtr_tools-1.1.8.dist-info/METADATA,sha256=lRqf1T5nQM155_hTay8XZjAK5A7YukM321G73D4BSWw,14646
62
+ fmtr_tools-1.1.8.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
63
+ fmtr_tools-1.1.8.dist-info/entry_points.txt,sha256=e-eOW1Ml13tbxHC6Er1MnVOEDePeWw7DKwlE-l-gCY0,205
64
+ fmtr_tools-1.1.8.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
65
+ fmtr_tools-1.1.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5