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

@@ -3,5 +3,6 @@ from fmtr.tools.import_tools import MissingExtraMockModule
3
3
  try:
4
4
  from fmtr.tools.interface_tools.interface_tools import Interface, update, progress
5
5
  from fmtr.tools.interface_tools import controls
6
+ from fmtr.tools.interface_tools.context import Context
6
7
  except ImportError as exception:
7
8
  Interface = update = progress = controls = MissingExtraMockModule('interface', exception)
@@ -0,0 +1,12 @@
1
+ from flet.core.page import Page
2
+
3
+ from fmtr.tools.data_modelling_tools import Base, MixinArbitraryTypes
4
+
5
+
6
+ class Context(Base, MixinArbitraryTypes):
7
+ """
8
+
9
+ Base context class
10
+
11
+ """
12
+ page: Page
@@ -1,12 +1,13 @@
1
- from functools import cached_property
2
-
3
1
  import flet as ft
4
2
  from flet.core.types import AppView
5
3
  from flet.core.view import View
4
+ from functools import cached_property
5
+ from typing import TypeVar, Generic, Type
6
6
 
7
7
  from fmtr.tools import environment_tools
8
8
  from fmtr.tools.constants import Constants
9
9
  from fmtr.tools.function_tools import MethodDecorator
10
+ from fmtr.tools.interface_tools.context import Context
10
11
  from fmtr.tools.logging_tools import logger
11
12
 
12
13
 
@@ -55,9 +56,10 @@ class progress(update):
55
56
  super().stop(instance)
56
57
 
57
58
 
59
+ T = TypeVar('T', bound=Context)
58
60
 
59
61
 
60
- class Interface(ft.Column):
62
+ class Interface(Generic[T], ft.Column):
61
63
  """
62
64
 
63
65
  Simple interface base class.
@@ -72,12 +74,15 @@ class Interface(ft.Column):
72
74
  ROUTE_ROOT = '/'
73
75
  SCROLL = ft.ScrollMode.AUTO
74
76
 
75
- def __init__(self, *args, **kwargs):
77
+ TypeContext: Type[T] = Context
78
+
79
+ def __init__(self, context: T, *args, **kwargs):
76
80
  """
77
81
 
78
82
  Instantiate and apply interface config
79
83
 
80
84
  """
85
+ self.context = context
81
86
  super().__init__(*args, **kwargs, scroll=self.SCROLL)
82
87
 
83
88
  @classmethod
@@ -88,9 +93,11 @@ class Interface(ft.Column):
88
93
 
89
94
  """
90
95
  if not page.on_route_change:
96
+ page.title = cls.TITLE
91
97
  page.theme = cls.get_theme()
92
98
  page.views.clear()
93
- self = cls()
99
+ context = cls.TypeContext(page=page)
100
+ self = cls(context)
94
101
  view = self.view
95
102
  if not view:
96
103
  view = self
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.39
1
+ 1.3.40
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.39
3
+ Version: 1.3.40
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
@@ -133,62 +133,62 @@ Requires-Dist: logfire[httpx]; extra == "webhook"
133
133
  Provides-Extra: browsers
134
134
  Requires-Dist: playwright; extra == "browsers"
135
135
  Provides-Extra: all
136
- Requires-Dist: Unidecode; extra == "all"
137
- Requires-Dist: tabulate; extra == "all"
138
- Requires-Dist: tokenizers; extra == "all"
139
- Requires-Dist: bokeh; extra == "all"
140
- Requires-Dist: google-auth; extra == "all"
141
- Requires-Dist: flet-video; extra == "all"
142
- Requires-Dist: appdirs; extra == "all"
143
- Requires-Dist: logfire[fastapi]; extra == "all"
144
136
  Requires-Dist: contexttimer; extra == "all"
145
- Requires-Dist: json_repair; extra == "all"
146
- Requires-Dist: httpx_retries; extra == "all"
147
- Requires-Dist: html2text; extra == "all"
148
- Requires-Dist: deepmerge; extra == "all"
149
- Requires-Dist: openpyxl; extra == "all"
150
- Requires-Dist: pandas; extra == "all"
151
- Requires-Dist: dnspython[doh]; extra == "all"
152
- Requires-Dist: docker; extra == "all"
153
- Requires-Dist: pymupdf; extra == "all"
137
+ Requires-Dist: flet[all]; extra == "all"
138
+ Requires-Dist: torchaudio; extra == "all"
139
+ Requires-Dist: yamlscript; extra == "all"
140
+ Requires-Dist: filetype; extra == "all"
141
+ Requires-Dist: logfire[httpx]; extra == "all"
142
+ Requires-Dist: transformers[sentencepiece]; extra == "all"
154
143
  Requires-Dist: google-auth-httplib2; extra == "all"
155
- Requires-Dist: pymupdf4llm; extra == "all"
156
- Requires-Dist: distributed; extra == "all"
157
- Requires-Dist: cachetools; extra == "all"
158
- Requires-Dist: peft; extra == "all"
159
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
144
+ Requires-Dist: diskcache; extra == "all"
145
+ Requires-Dist: appdirs; extra == "all"
160
146
  Requires-Dist: faker; extra == "all"
161
- Requires-Dist: filetype; extra == "all"
162
- Requires-Dist: sentence_transformers; extra == "all"
163
- Requires-Dist: setuptools; extra == "all"
164
- Requires-Dist: yamlscript; extra == "all"
147
+ Requires-Dist: deepmerge; extra == "all"
148
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
149
+ Requires-Dist: openai; extra == "all"
150
+ Requires-Dist: distributed; extra == "all"
151
+ Requires-Dist: httpx; extra == "all"
165
152
  Requires-Dist: dask[bag]; extra == "all"
166
- Requires-Dist: logfire[httpx]; extra == "all"
167
- Requires-Dist: flet[all]; extra == "all"
168
- Requires-Dist: pydantic; extra == "all"
169
- Requires-Dist: regex; extra == "all"
170
- Requires-Dist: google-api-python-client; extra == "all"
171
- Requires-Dist: huggingface_hub; extra == "all"
172
- Requires-Dist: pydantic-settings; extra == "all"
153
+ Requires-Dist: tokenizers; extra == "all"
154
+ Requires-Dist: docker; extra == "all"
155
+ Requires-Dist: sentence_transformers; extra == "all"
173
156
  Requires-Dist: tinynetrc; extra == "all"
174
- Requires-Dist: transformers[sentencepiece]; extra == "all"
157
+ Requires-Dist: google-api-python-client; extra == "all"
158
+ Requires-Dist: dnspython[doh]; extra == "all"
159
+ Requires-Dist: fastapi; extra == "all"
160
+ Requires-Dist: uvicorn[standard]; extra == "all"
161
+ Requires-Dist: html2text; extra == "all"
175
162
  Requires-Dist: ollama; extra == "all"
176
- Requires-Dist: google-auth-oauthlib; extra == "all"
177
163
  Requires-Dist: pytest-cov; extra == "all"
178
- Requires-Dist: torchaudio; extra == "all"
179
- Requires-Dist: httpx; extra == "all"
180
- Requires-Dist: uvicorn[standard]; extra == "all"
181
- Requires-Dist: diskcache; extra == "all"
182
- Requires-Dist: playwright; extra == "all"
183
- Requires-Dist: logfire; extra == "all"
184
- Requires-Dist: fastapi; extra == "all"
185
- Requires-Dist: sre_yield; extra == "all"
186
- Requires-Dist: openai; extra == "all"
164
+ Requires-Dist: pymupdf; extra == "all"
165
+ Requires-Dist: json_repair; extra == "all"
166
+ Requires-Dist: logfire[fastapi]; extra == "all"
167
+ Requires-Dist: tabulate; extra == "all"
168
+ Requires-Dist: cachetools; extra == "all"
187
169
  Requires-Dist: semver; extra == "all"
170
+ Requires-Dist: huggingface_hub; extra == "all"
171
+ Requires-Dist: openpyxl; extra == "all"
188
172
  Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
189
- Requires-Dist: torchvision; extra == "all"
190
- Requires-Dist: pyyaml; extra == "all"
173
+ Requires-Dist: pymupdf4llm; extra == "all"
174
+ Requires-Dist: playwright; extra == "all"
175
+ Requires-Dist: sre_yield; extra == "all"
191
176
  Requires-Dist: flet-webview; extra == "all"
177
+ Requires-Dist: google-auth-oauthlib; extra == "all"
178
+ Requires-Dist: Unidecode; extra == "all"
179
+ Requires-Dist: setuptools; extra == "all"
180
+ Requires-Dist: google-auth; extra == "all"
181
+ Requires-Dist: pyyaml; extra == "all"
182
+ Requires-Dist: pydantic; extra == "all"
183
+ Requires-Dist: pandas; extra == "all"
184
+ Requires-Dist: regex; extra == "all"
185
+ Requires-Dist: logfire; extra == "all"
186
+ Requires-Dist: peft; extra == "all"
187
+ Requires-Dist: pydantic-settings; extra == "all"
188
+ Requires-Dist: httpx_retries; extra == "all"
189
+ Requires-Dist: flet-video; extra == "all"
190
+ Requires-Dist: bokeh; extra == "all"
191
+ Requires-Dist: torchvision; extra == "all"
192
192
  Dynamic: author
193
193
  Dynamic: author-email
194
194
  Dynamic: description
@@ -45,7 +45,7 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,1
45
45
  fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
46
46
  fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
47
47
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
48
- fmtr/tools/version,sha256=X0h-7BeauKqNJDa25REZFacQpPeKRTGCByBGn_deWBk,6
48
+ fmtr/tools/version,sha256=509ysBiNGW5G48sMKppbTs43JeWeaLLb02lbfZjkc48,6
49
49
  fmtr/tools/webhook_tools.py,sha256=q3pVJ1NCem2SrMuFcLxiWd7DibFs7Q-uGtojfXd3Qcg,380
50
50
  fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
51
51
  fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
@@ -62,9 +62,10 @@ fmtr/tools/entrypoints/ep_test.py,sha256=B8HfWISfSgw_xVX475CbJGh_QnpOe9MH65H8qGj
62
62
  fmtr/tools/entrypoints/install_yamlscript.py,sha256=D9-QET4uPkwMvOBQJAgzn1fYb7Z7VAgZzFdHSAXc3Qc,116
63
63
  fmtr/tools/entrypoints/remote_debug_test.py,sha256=wmKg9o2pQq7eqeHmaO8oviujNgtnsCVEXOdXLIcQWs4,123
64
64
  fmtr/tools/entrypoints/shell_debug.py,sha256=0No3tAg9Ri4_vvSlQCUtAY-11HR0nE45i0VVtiAViwY,106
65
- fmtr/tools/interface_tools/__init__.py,sha256=nODVT7v657onpmak7qbW4P8NoW2HQqyeEDUSx5pZAFg,331
65
+ fmtr/tools/interface_tools/__init__.py,sha256=hgierRDkJDXrYkPM4z-m44aL7OMS8DKNKJzaXayBmw4,390
66
+ fmtr/tools/interface_tools/context.py,sha256=vTrHwat2s71HCZZySerIlkvhVeeDzyuAWeY4puLVqSY,203
66
67
  fmtr/tools/interface_tools/controls.py,sha256=oOl0_sZB8fkvYB-9A5yjArfQmFQLMCsVGgRNrJAFJm4,332
67
- fmtr/tools/interface_tools/interface_tools.py,sha256=a7WRwf8TKek8ML08ANfkncLfoMHWk5b_929bFf3Y6cQ,3577
68
+ fmtr/tools/interface_tools/interface_tools.py,sha256=y1Lnphbc00kBjP4GyR5YPtMevUS9BR1weex-J3qEw5A,3887
68
69
  fmtr/tools/path_tools/__init__.py,sha256=v5CpmzXq5Ii90FtcmxAJKiLxmguZMrPnQ_HdT872Np0,443
69
70
  fmtr/tools/path_tools/app_path_tools.py,sha256=JrJvtTDd_gkCKcZtBCDTMktsM77PZwGV_hzQX0g5GU8,1722
70
71
  fmtr/tools/path_tools/path_tools.py,sha256=eh30PpmH0wopy0wNWuPT84cmXY1EvqsTSDT7AV_GPOY,8034
@@ -81,9 +82,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
81
82
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
82
83
  fmtr/tools/version_tools/__init__.py,sha256=pg4iLtmIr5HtyEW_j0fMFoIdzqi_w9xH8-grQaXLB28,318
83
84
  fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
84
- fmtr_tools-1.3.39.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
85
- fmtr_tools-1.3.39.dist-info/METADATA,sha256=LioB91BL767fAM6aTZjf73CDtwZD39UnOw6XnrMcSuk,16259
86
- fmtr_tools-1.3.39.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
- fmtr_tools-1.3.39.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
88
- fmtr_tools-1.3.39.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
89
- fmtr_tools-1.3.39.dist-info/RECORD,,
85
+ fmtr_tools-1.3.40.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
86
+ fmtr_tools-1.3.40.dist-info/METADATA,sha256=m6rHbc4NRBpELpK60mCP5SB9qOwm-EolTfaKyKKCMRQ,16259
87
+ fmtr_tools-1.3.40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
88
+ fmtr_tools-1.3.40.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
89
+ fmtr_tools-1.3.40.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
90
+ fmtr_tools-1.3.40.dist-info/RECORD,,