fmtr.tools 1.0.31__py3-none-any.whl → 1.0.32__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/api_tools.py CHANGED
@@ -83,6 +83,11 @@ class ApiBase:
83
83
 
84
84
  @classmethod
85
85
  def launch(cls):
86
+ """
87
+
88
+ Initialise self and launch.
89
+
90
+ """
86
91
  self = cls()
87
92
  logger.info(f'Launching API {cls.TITLE}...')
88
93
  uvicorn.run(self.app, host=self.HOST, port=self.PORT)
fmtr/tools/path_tools.py CHANGED
@@ -96,6 +96,29 @@ class Path(type(Path())):
96
96
  """
97
97
  return cls(gettempdir())
98
98
 
99
+ @classmethod
100
+ def data(cls, name='data') -> 'Path':
101
+ """
102
+
103
+ Fetch canonical "data"/"artifacts" path, whether calling package is regular or namespace package.
104
+
105
+ """
106
+ from fmtr.tools.inspection_tools import get_call_path
107
+ path = get_call_path()
108
+ path = path.absolute().parent.parent
109
+
110
+ path /= name
111
+
112
+ if path.exists():
113
+ return path
114
+
115
+ path = path.parent.parent / name
116
+
117
+ if path.exists():
118
+ return path
119
+
120
+ raise FileNotFoundError(f'No "{name}" directory found at "{path}"')
121
+
99
122
  def write_json(self, obj) -> int:
100
123
  """
101
124
 
@@ -145,3 +145,10 @@ class Mask:
145
145
  return text
146
146
  except (KeyError, IndexError):
147
147
  return self
148
+
149
+
150
+ if __name__ == '__main__':
151
+ import numpy as np
152
+
153
+ st = join([1, None, 'test', np.nan, 0, '', 'yeah'])
154
+ st
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.0.31
1
+ 1.0.32
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fmtr.tools
3
- Version: 1.0.31
3
+ Version: 1.0.32
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
@@ -1,6 +1,6 @@
1
1
  fmtr/tools/__init__.py,sha256=imKjjZg5HypnRy5bD4Xe6HBkQhavg6BOkwIeFzItG_8,5052
2
2
  fmtr/tools/ai_tools.py,sha256=hN7DzuATXfurCDHugaluUsbmF_PzeKu3BTc2WXhG59g,11806
3
- fmtr/tools/api_tools.py,sha256=KU_qetI7WQRZijZ0l1nCKjPcRbseMMCWj0W8n_NTJCM,2027
3
+ fmtr/tools/api_tools.py,sha256=u5YEdKyKto8MKY8legULLU7xeJ7lY2Bgyaep_xa8iZg,2089
4
4
  fmtr/tools/async_tools.py,sha256=ewz757WcveQJd-G5SVr2JDOQVbdLGecCgl-tsBGVZz4,284
5
5
  fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCBej0,55
6
6
  fmtr/tools/caching_tools.py,sha256=UOCYUNvLQ-NofR_dhqBmZF96-HRPf4At5MmxVk3gAIk,2943
@@ -30,18 +30,18 @@ fmtr/tools/name_tools.py,sha256=5CB_phqhHjl66iI8oLxOGPF2odC1apdul-M8Fv2xBhs,5514
30
30
  fmtr/tools/netrc_tools.py,sha256=PpNpz_mWlQi6VHGromKwFfTyLpHUXsd4LY6-OKLCbeI,376
31
31
  fmtr/tools/openai_tools.py,sha256=6SUgejgzUzmlKKct2_ePXntvMegu3FJgfk9x7aqtqYc,742
32
32
  fmtr/tools/parallel_tools.py,sha256=G__ZbLRRx4cP5OyqY1hKwnE-VI3m5prYABB0tnZHnes,3132
33
- fmtr/tools/path_tools.py,sha256=iNIG-nxBX-uiyfyOapJZaUiS4pI8sHsxm6WhVHixQ0M,3700
33
+ fmtr/tools/path_tools.py,sha256=1GeWXdhV5rH99IfLI5ZFEnOJfs4Q4mYTT2R-rA791iQ,4273
34
34
  fmtr/tools/platform_tools.py,sha256=7p69CmAHe_sF68Fx9uVhns1k5EewTHTWgUYzkl6ZQKA,308
35
35
  fmtr/tools/process_tools.py,sha256=Ysh5Dk2QFBhXQerArjKdt7xZd3JrN5Ho02AaOjH0Nnw,1425
36
36
  fmtr/tools/profiling_tools.py,sha256=jpXVjaNKPydTasEQVNXvxzGtMhXPit08AnJddkU8uIc,46
37
37
  fmtr/tools/random_tools.py,sha256=4VlQdk5THbR8ka4pZaLbk_ZO_4yy6PF_lHZes_rgenY,2223
38
38
  fmtr/tools/semantic_tools.py,sha256=cxY9NSAHWj4nEc6Oj4qA1omR3dWbl2OuH7_PkINc6_E,1386
39
39
  fmtr/tools/spaces_tools.py,sha256=D_he3mve6DruB3OPS6QyzqD05ChHnRTb4buViKPe7To,1099
40
- fmtr/tools/string_tools.py,sha256=w0lw70bgzJ8tAHj_4lMrjtMyefE5kELgpCBgGzGcalo,3117
40
+ fmtr/tools/string_tools.py,sha256=U2EptMWR6KDOP22ZQ4ReUHV4i25SP7xwCmZScI1sy4M,3233
41
41
  fmtr/tools/tokenization_tools.py,sha256=9FP5vgPufWv0XA961eVKObFll0d_2mM0W3ut3rtZyeo,4329
42
42
  fmtr/tools/tools.py,sha256=xnfUrOnrT4OxFYez6vV5tAhydzCICJFiGVnviiZDEQo,796
43
43
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
44
- fmtr/tools/version,sha256=VmLTmBbOULW3noulizLqu_B8fqxN0ySSfEW-8f3y1Sk,6
44
+ fmtr/tools/version,sha256=lJlaFE-y4dFjsYr6jbTGb5uzUQ_dp_LO5e9G4R2TeMk,6
45
45
  fmtr/tools/version_tools.py,sha256=axzzHBS9V1n6YuSacsDKG3VfAvRqR8qr6aENCibR8vs,1248
46
46
  fmtr/tools/yaml_tools.py,sha256=Ol43ZwbnSXGnn1K98Uxx61KPGSqfC4axE-X2q1LKMwk,349
47
47
  fmtr/tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -52,9 +52,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
52
52
  fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
53
53
  fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
54
54
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
55
- fmtr.tools-1.0.31.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
56
- fmtr.tools-1.0.31.dist-info/METADATA,sha256=VOhy728mlqRmzO9jP8wUEN8rWHYap9dcf9AA0beu9r8,13207
57
- fmtr.tools-1.0.31.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
58
- fmtr.tools-1.0.31.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
59
- fmtr.tools-1.0.31.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
60
- fmtr.tools-1.0.31.dist-info/RECORD,,
55
+ fmtr.tools-1.0.32.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
56
+ fmtr.tools-1.0.32.dist-info/METADATA,sha256=iPCoZOCJ1UbUM0x2NVVcWQiEg-Co8RZNSQIy1cgHErQ,13207
57
+ fmtr.tools-1.0.32.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
58
+ fmtr.tools-1.0.32.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
59
+ fmtr.tools-1.0.32.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
60
+ fmtr.tools-1.0.32.dist-info/RECORD,,