instaui 0.1.8__py3-none-any.whl → 0.1.9__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.
@@ -1,9 +1,7 @@
1
1
  from __future__ import annotations
2
2
  import typing
3
- from pathlib import Path
4
3
  from dataclasses import dataclass, field
5
4
  from instaui.common.jsonable import dumps
6
- from instaui.runtime.dataclass import JsLink
7
5
  from .env import env
8
6
 
9
7
 
@@ -50,6 +50,7 @@ class WebComputed(
50
50
  extend_outputs: Optional[Sequence[CanOutputMixin]] = None,
51
51
  init_value: Optional[R] = None,
52
52
  evaluating: Optional[CanOutputMixin] = None,
53
+ debug_info: Optional[Dict] = None,
53
54
  ) -> None:
54
55
  scope = get_current_scope()
55
56
 
@@ -65,6 +66,9 @@ class WebComputed(
65
66
  self._init_value = init_value
66
67
  self._evaluating = evaluating
67
68
 
69
+ if debug_info is not None:
70
+ self.debug = debug_info
71
+
68
72
  def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R:
69
73
  return self._fn(*args, **kwargs)
70
74
 
@@ -140,6 +144,7 @@ def web_computed(
140
144
  extend_outputs: Optional[Sequence] = None,
141
145
  init_value: Optional[Any] = None,
142
146
  evaluating: Optional[Any] = None,
147
+ debug_info: Optional[Dict] = None,
143
148
  ):
144
149
  def wrapper(func: Callable[P, R]):
145
150
  return WebComputed(
@@ -148,6 +153,7 @@ def web_computed(
148
153
  extend_outputs=extend_outputs,
149
154
  init_value=init_value,
150
155
  evaluating=evaluating,
156
+ debug_info=debug_info,
151
157
  )
152
158
 
153
159
  return wrapper
@@ -1 +1,2 @@
1
+ __all__ = ["WebviewWrapper"]
1
2
  from .index import WebviewWrapper
instaui/webview/index.py CHANGED
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
  from contextlib import contextmanager
3
3
  from pathlib import Path
4
- import shutil
5
4
  from typing import Any, Callable, Dict, Iterable, List, Optional, Union
6
5
  from typing_extensions import TypedDict, Unpack
7
6
  import webview
@@ -1,33 +1,27 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: instaui
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: insta-ui is a Python-based UI library for rapidly building user interfaces.
5
- License: MIT
6
- Author: CrystalWindSnake
7
- Author-email: 568166495@qq.com
8
- Requires-Python: >=3.8,<3.13
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
5
+ Author-email: CrystalWindSnake <568166495@qq.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: gui,ui,web
9
+ Requires-Python: <3.13,>=3.8
10
+ Requires-Dist: jinja2>=3.1.6
11
+ Requires-Dist: orjson>=3.10.15
12
+ Requires-Dist: pydantic>=2.10.6
13
+ Requires-Dist: typing-extensions>=4.13.2
16
14
  Provides-Extra: all
15
+ Requires-Dist: fastapi[standard]; extra == 'all'
16
+ Requires-Dist: pywebview; extra == 'all'
17
+ Requires-Dist: uvicorn; extra == 'all'
17
18
  Provides-Extra: web
19
+ Requires-Dist: fastapi[standard]; extra == 'web'
20
+ Requires-Dist: pydantic<3.0.0,>=2.10.6; extra == 'web'
21
+ Requires-Dist: uvicorn; extra == 'web'
18
22
  Provides-Extra: webview
19
- Requires-Dist: fastapi[standard] ; extra == "all"
20
- Requires-Dist: fastapi[standard] ; extra == "web"
21
- Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
22
- Requires-Dist: orjson (>=3.10.15,<4.0.0)
23
- Requires-Dist: pydantic (>=2.10.6,<3.0.0)
24
- Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "web"
25
- Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "webview"
26
- Requires-Dist: pywebview ; extra == "all"
27
- Requires-Dist: pywebview ; extra == "webview"
28
- Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
29
- Requires-Dist: uvicorn ; extra == "all"
30
- Requires-Dist: uvicorn ; extra == "web"
23
+ Requires-Dist: pydantic<3.0.0,>=2.10.6; extra == 'webview'
24
+ Requires-Dist: pywebview; extra == 'webview'
31
25
  Description-Content-Type: text/markdown
32
26
 
33
27
  # insta-ui
@@ -157,4 +151,3 @@ def counter():
157
151
  html.button(text).on_click(add_count)
158
152
 
159
153
  ```
160
-
@@ -1,9 +1,19 @@
1
1
  instaui/__init__.py,sha256=AUc9WcEoBimqYCunwNghawZKuhup_qYd1bor5Go1qmA,161
2
+ instaui/boot_info.py,sha256=2uIkRaNhuUCG6Jbyl2Gb0_1IbVxtfJ8s2j6X1XXdSk0,905
3
+ instaui/consts.py,sha256=3le1YZTV2PM_jXgvEDWlBeGEJz8QIZ2StvA9MZpem_g,967
4
+ instaui/html_tools.py,sha256=VJDnOdPPDzXi_u6bMj5_fqdFjGXG3-HgXQsvD0gfauc,2577
5
+ instaui/inject.py,sha256=NeTcsxoPdo12kZCvGjFU9NNHsVWnsPJfIcNY5_sPGYc,727
6
+ instaui/launch_collector.py,sha256=_YmF3hsNWe-ZxMp_amqUBHkhB6fOuTPfX16BVwn25xg,1731
7
+ instaui/page_info.py,sha256=aJtfLp2h05tCuLzxk2pZ6a9ztyxSdI-g3NBRxbqpS6E,269
8
+ instaui/skip.py,sha256=uqhqusgeChVoivKFMoZd-XePYrlSoLvUzRZDBcUgFmA,149
9
+ instaui/version.py,sha256=to8l16EjNe4jmzK316s5ZIotjv554tqF0VfwA1tBhQk,87
2
10
  instaui/_helper/observable_helper.py,sha256=8giJzjf4483pr-LFYnRguXv6-DQtxdYmTtXt0aXOE7g,1105
3
11
  instaui/arco/__init__.py,sha256=_QuzxGbuQKuq9hjem65NKqYwiKDAP_3ZVPHy75Idw_s,6155
4
12
  instaui/arco/_settings.py,sha256=iuWQb-sGNlw4fBxf-Ufj-YGnBXaGVJIDMgPuVg9ZJ38,771
5
- instaui/arco/_use_tools/locale.py,sha256=30-3dYbTV0aIoA3cMAH-TWreDZA94bf0LrKbJl5vCzk,1295
6
13
  instaui/arco/component_types.py,sha256=wAJvOw4SGbf8bcC3QTdJonsWk5SsRVui-imsKdg-Nzo,39397
14
+ instaui/arco/setup.py,sha256=iKyb7oDXSkpPUmYNF_4H4wzIG-dZMWjOys97wr6EsG4,996
15
+ instaui/arco/types.py,sha256=3p55fBzYbpw633WmyFS7WdMcosBLme39VT4C1fbtQcg,341
16
+ instaui/arco/_use_tools/locale.py,sha256=30-3dYbTV0aIoA3cMAH-TWreDZA94bf0LrKbJl5vCzk,1295
7
17
  instaui/arco/components/_utils.py,sha256=JpofPvCwVJYw_LbN3ZTFOFqT16mj4mF5pS3lgkr_gR4,547
8
18
  instaui/arco/components/affix.py,sha256=IHst2isiW4Ujwb5YeLJA7L4GQ2jEI-gGKD0hw6y4t-w,711
9
19
  instaui/arco/components/alert.py,sha256=Q8To4MtXMBwU2z6pL8s4Sto0fQVkheoFT8ZeOSAacB4,986
@@ -87,22 +97,26 @@ instaui/arco/locales/__init__.py,sha256=I4wf2qQymrPU_E_EXKni4_me0m2KSr7Sfx9ZbRR1
87
97
  instaui/arco/locales/_index.py,sha256=cZXwVTBWqM5vASvMnlTHjdWfF5eAdCXT53K_JFhEpEU,806
88
98
  instaui/arco/locales/en_us.py,sha256=pIU4zBIhoWj5y0PhKoKjSAPZ6y3VSUfIcCGyhce5o08,8294
89
99
  instaui/arco/locales/zh_cn.py,sha256=Zeyvm-kh7fhPGe5KZMo_qt8I1s6MkveOk5mMfAYso0k,8182
90
- instaui/arco/setup.py,sha256=iKyb7oDXSkpPUmYNF_4H4wzIG-dZMWjOys97wr6EsG4,996
91
- instaui/arco/static/instaui-arco.css,sha256=AlEqqPeOS_-ebbM7bsbSqDw2DgNJy5lIil6O5MYf6XM,399576
92
- instaui/arco/static/instaui-arco.js,sha256=Rf9xrkCK6lD2cUED6pd15Ge-SFmX_SByOzaC2kBqDTE,1609202
93
- instaui/arco/types.py,sha256=3p55fBzYbpw633WmyFS7WdMcosBLme39VT4C1fbtQcg,341
94
- instaui/boot_info.py,sha256=2uIkRaNhuUCG6Jbyl2Gb0_1IbVxtfJ8s2j6X1XXdSk0,905
100
+ instaui/arco/static/instaui-arco.css,sha256=PRnu2GBck04qO-PjCQMoNdETxBlDcxGjA7zHrdBBUfU,399577
101
+ instaui/arco/static/instaui-arco.js,sha256=PktbvZE6yids2NyfSKo81g--fCo-AiNEdOgvv8gmUB8,1664973
95
102
  instaui/common/jsonable.py,sha256=efzn_IvfrsaNKjc3B3UzshoMvsqSsB-jnD2Aia8YMYM,902
96
103
  instaui/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
104
  instaui/components/column.py,sha256=t_kDAelb-5_aqx4hv19sOm8zcQpRmn-slTMcwZfMOLk,848
98
105
  instaui/components/component.py,sha256=cfKWlhxATdvERSzsVzvLtm61f72_gblhLJXIrXLGQrk,1284
99
106
  instaui/components/content.py,sha256=f6dm0GukYJk4RRNJzuvOGqBrStLWkJQbLkV7M5fJ63k,1094
100
107
  instaui/components/directive.py,sha256=bHSOWXNhzWRVNqLXwhc_hY3R3g-JAQ5DWIqpZkI6_wI,1411
108
+ instaui/components/element.py,sha256=7kxQTSx-JbJ1ndSpEjSnUwYXIajxaR5kPYNP3kkDk9U,17698
109
+ instaui/components/grid.py,sha256=9agGF1JtMi7k453nSynIAhN4T1ssa7WE7zXHbq9ift4,5569
110
+ instaui/components/match.py,sha256=B3wV1h-SkvYnX8RiMObdM2tfJb8nW2gjFxXQvNeZWWM,2774
111
+ instaui/components/row.py,sha256=c0dxJwt955EF7PXlrFpqIoQNZ59tJm-UvZlx_zjeuBg,570
112
+ instaui/components/slot.py,sha256=RT0eU7wH7ffFDkl5ucfrNXB1nbsKDq688Hp920TZaoo,2287
113
+ instaui/components/transition_group.py,sha256=H9zx9NTlCoQnBArWfmxmh7CMKb5hZn8vKrFe4OFxPrE,201
114
+ instaui/components/value_element.py,sha256=wRIAaR3_Cq9qLNJw2KPhWt7dJmclj1mrttzlGpb01Y0,1412
115
+ instaui/components/vfor.py,sha256=A6hvCpmY-5oNZLnIs2yvfQ12C1-GggKVAthqhi5E4lY,4031
116
+ instaui/components/vif.py,sha256=2E62-8J9NIlZDhvgIOuDwz0tLLb6VoJ1ji1K4okrapw,1165
101
117
  instaui/components/echarts/echarts.js,sha256=dXW6gzrBpzt7ZRy5LDJYxkO4PnP37A1KUAWm9391B1M,2673
102
118
  instaui/components/echarts/echarts.py,sha256=JX2NXSVqhZYMXIINgO4AFTQOZ2YDIbib1_kYcWRBMGg,5445
103
119
  instaui/components/echarts/static/echarts.esm.min.js,sha256=KN8OVRa4kTlat9NIfArzA3rtGcYfyrkcwjFBy_07vu8,1033915
104
- instaui/components/element.py,sha256=7kxQTSx-JbJ1ndSpEjSnUwYXIajxaR5kPYNP3kkDk9U,17698
105
- instaui/components/grid.py,sha256=9agGF1JtMi7k453nSynIAhN4T1ssa7WE7zXHbq9ift4,5569
106
120
  instaui/components/html/__init__.py,sha256=9bO1ai0aQCWwj80NKqDeq_3zwMg5gf17mE40a1IESAk,1088
107
121
  instaui/components/html/_mixins.py,sha256=5dcSM9h1PswIKL6_eiqUxqW4H2OCuyNeCuRZq3gDGOc,876
108
122
  instaui/components/html/_preset.py,sha256=c5rTj3r8W7UP0UHFLUW-ZSPedIa-gzrsU1goi60l20Q,94
@@ -119,47 +133,34 @@ instaui/components/html/link.py,sha256=eNC2f-twFZUhw_rL-Ggff2Lo8NRU33oF8CfWW_9-k
119
133
  instaui/components/html/number.py,sha256=Y2oIzTMHKWMWpufG55tFz0npEoEFvLhTWpZbMJ8J07s,1069
120
134
  instaui/components/html/paragraph.py,sha256=U0ePdkQhmt6fdLhLsZ3IVsIBdHBw4mOxhEwfioHzoyY,442
121
135
  instaui/components/html/range.py,sha256=cLGoo3QaARG9YDnh6g3UYtc1yueI5dfMa9-4e-feSn4,1644
122
- instaui/components/html/select.py,sha256=AKtHqmx92_7L0YtGFB77JDqFcNTe_a5BNFU_m4ihuZs,2126
136
+ instaui/components/html/select.py,sha256=Bq6mwyKa1qAk7bZiHK0uOg65W2twz4QkcJQTjvFNDP4,2029
123
137
  instaui/components/html/span.py,sha256=RJnccwnYEh8PUZ36VTBCKzBNV74M3SMohAejb0ck0UI,440
124
- instaui/components/html/table.py,sha256=fPjZg--x6vIjtt7ExjjTIVe9sMv6dz13BS1c4Iz_qao,1502
138
+ instaui/components/html/table.py,sha256=1n46pPOMKkFfEsHB0Qwep-ELShm-jeeCSOfznfY1mSc,1492
125
139
  instaui/components/html/textarea.py,sha256=EsVir5nOQDlf5hlmfdWfdfGv-owk-ajPJYOGCbzWVu4,900
126
140
  instaui/components/html/ul.py,sha256=YbP2kH0Utlwr194uvVlCNQk1Xfl-5O24nVsDHSM0dqg,545
127
141
  instaui/components/markdown/markdown.js,sha256=ZlwxvQJ_0Fq1R-j-unfQTWMRswJ8GsYgLvd-wxVISGc,682
128
142
  instaui/components/markdown/markdown.py,sha256=2_ECsZPJ2P5hdP5-Kna0KwoFtHEzk8hgtTZ9rPX5Mds,978
129
143
  instaui/components/markdown/static/github-markdown.css,sha256=_uphCFXVa_Hhwyfs7ps-wcpBuzA7_RhkiX7DuxuLIzI,42536
130
144
  instaui/components/markdown/static/marked.esm.js,sha256=mgAILO5RXoifHq_HxqoWQ6qcMn_Xw8jYuNHdgoIV-xw,99306
131
- instaui/components/match.py,sha256=B3wV1h-SkvYnX8RiMObdM2tfJb8nW2gjFxXQvNeZWWM,2774
132
- instaui/components/row.py,sha256=luiBNCgGOMhMZlN6AYaS4qyXV0MNQQSiyshUWui4Je8,609
133
145
  instaui/components/shiki_code/shiki_code.js,sha256=b4Z_yfKAnZsma7T51aDUljXn45Jd-AJH-Z1vRO1zaQg,3137
134
146
  instaui/components/shiki_code/shiki_code.py,sha256=0FonvKvFKrGfz-xWlJJqGZt0TDSkZQr-4u3E9_CEbDk,3100
147
+ instaui/components/shiki_code/static/shiki-core.js,sha256=UL04NBlHkWnjncUOLsNx5mMHCXUUh2t9hVLJPpSOAqs,787821
148
+ instaui/components/shiki_code/static/shiki-style.css,sha256=K4EIv7kBzwf1t6WoqwKrxJDqBVgz1DhzCuEfQGDFUBE,6432
149
+ instaui/components/shiki_code/static/shiki-transformers.js,sha256=JtWn48oj_ppT2-RDbbLnmBjtIvnBRHkgwFcO4hj0yx0,12744
135
150
  instaui/components/shiki_code/static/langs/css.mjs,sha256=vCN8-QsQSqpj1kE5F9whUvBr39IsRtC3Ql7RxIGfw2Y,52249
136
151
  instaui/components/shiki_code/static/langs/markdown.mjs,sha256=wTkMkPZpF-xRGxiQDtoNHk0KUzYM1nheKGOlyX4P2Sw,61684
137
152
  instaui/components/shiki_code/static/langs/python.mjs,sha256=h9AiQgl4T1pP_s9xgMSdTp7UjPs1hpHruOQOqvIGFIQ,77213
138
153
  instaui/components/shiki_code/static/langs/shell.mjs,sha256=tFnepW_2H4k-TKg0X2a5eFxSVUu69tvLsBACE8CppPk,91
139
154
  instaui/components/shiki_code/static/langs/shellscript.mjs,sha256=hUZDCGMkHhsWI8d8RJwqC5DENXuUoJgFmrgJFnuN_Gw,45548
140
- instaui/components/shiki_code/static/shiki-core.js,sha256=UL04NBlHkWnjncUOLsNx5mMHCXUUh2t9hVLJPpSOAqs,787821
141
- instaui/components/shiki_code/static/shiki-style.css,sha256=Nvj4q_pjgisJJ1bmC0BVgdeYZIOPfvKrboCMjQ9a8bs,6253
142
- instaui/components/shiki_code/static/shiki-transformers.js,sha256=JtWn48oj_ppT2-RDbbLnmBjtIvnBRHkgwFcO4hj0yx0,12744
143
155
  instaui/components/shiki_code/static/themes/vitesse-dark.mjs,sha256=OqDIbeBNg40dGoy2Ef02zM7aS7QTcC3bah6ZzvtkpbA,15326
144
156
  instaui/components/shiki_code/static/themes/vitesse-light.mjs,sha256=RWgJuEHtO93_BSyNYuenSW6O_x1fv01aiGRO0ZF_qdo,15176
145
- instaui/components/slot.py,sha256=RT0eU7wH7ffFDkl5ucfrNXB1nbsKDq688Hp920TZaoo,2287
146
- instaui/components/transition_group.py,sha256=H9zx9NTlCoQnBArWfmxmh7CMKb5hZn8vKrFe4OFxPrE,201
147
- instaui/components/value_element.py,sha256=wRIAaR3_Cq9qLNJw2KPhWt7dJmclj1mrttzlGpb01Y0,1412
148
- instaui/components/vfor.py,sha256=A6hvCpmY-5oNZLnIs2yvfQ12C1-GggKVAthqhi5E4lY,4031
149
- instaui/components/vif.py,sha256=2E62-8J9NIlZDhvgIOuDwz0tLLb6VoJ1ji1K4okrapw,1165
150
- instaui/consts.py,sha256=3le1YZTV2PM_jXgvEDWlBeGEJz8QIZ2StvA9MZpem_g,967
151
157
  instaui/dependencies/component_dependency.py,sha256=V9L9YmM0_d1bQFMea3aH8qYG_mvGsAVPhmz0UHZa3PQ,672
152
158
  instaui/dependencies/plugin_dependency.py,sha256=6u562ihKbiL3DE4hBrGjauS2nzYEC2glOVN0fwEVNVc,806
153
159
  instaui/event/event_mixin.py,sha256=cN0Wh95e1wX183mGnGFm8BK_aEHWJ8WNx3Upy75mU_4,286
154
160
  instaui/event/js_event.py,sha256=C6TS-sgHiUtCSAFpkDDaI1vKzc4F-ZA1zauf3GTiFX4,1780
155
161
  instaui/event/web_event.py,sha256=ddb91alNOuafYt1xOPVADqCy36_CQN4r8EfgLpsxmBM,3207
156
- instaui/experimental/__init__.py,sha256=mla0-czeN-1mBNReWSEnMLwBvERMVceQfHGAdCdlyR4,122
162
+ instaui/experimental/__init__.py,sha256=nKvudMaBaDsxflSZQ00ck8Cc4hmrF0f6Xzs4mhIYa08,75
157
163
  instaui/experimental/debug.py,sha256=UGUWgNZ3ShanpuxfuPdx52TgQrkO9hByABYMnPZEIiE,1325
158
- instaui/experimental/link_sql/__init__.py,sha256=Us-KAILRDR19LrV8aCl0t4LFxtGxnctPwlYY82pjxwM,64
159
- instaui/experimental/link_sql/_base.py,sha256=p94z9k3MelA24Ibl9STqnySWF-efha9Qjibg17yaXTI,556
160
- instaui/experimental/link_sql/_duckdb.py,sha256=DnX2nWJnGBbt1BKncChxDT5zW5S3zJxE668tWdC_jvc,7284
161
- instaui/experimental/link_sql/_types.py,sha256=KkGWUVE1WI36NA-z78FdjQvOCzzNwLUFDYrgHcWdCm8,262
162
- instaui/experimental/link_sql/data_source.js,sha256=rFuEfKO3ajE-Xt_DHtGOmmZDxanXaBbss8UWk3H3kmo,1193
163
164
  instaui/fastapi_server/_utils.py,sha256=MCqbebS4UkBOV8fp3Oy415Tvxnqi2mnMl5Eqe6yJogg,1177
164
165
  instaui/fastapi_server/_uvicorn.py,sha256=n-es5ajWepXb6xF9EP0ft2lrEbsyLGWMUE7uVqpkUAs,1174
165
166
  instaui/fastapi_server/debug_mode_router.py,sha256=EcYtPxI4FMnUqZcn-CZhZiMLgciHVNZpSRfiSIDRChc,1547
@@ -173,13 +174,9 @@ instaui/fastapi_server/watch_router.py,sha256=KC8AbGNpH2x11PHQMPgc9N5WOlqW05i6r0
173
174
  instaui/handlers/_utils.py,sha256=EB5mTb6flhMeuwm2Byb5jp18WqMngOuv3jC_PmycrA0,2076
174
175
  instaui/handlers/event_handler.py,sha256=hjxi_nDh0yjk9EmRgew1USXk-Egd4pR8YnUiOcJbbnc,1761
175
176
  instaui/handlers/watch_handler.py,sha256=Ay4lubEdRnZcWSqWLwxQyS_uWiF0gu-E9PrNGCAHvL0,1600
176
- instaui/html_tools.py,sha256=VJDnOdPPDzXi_u6bMj5_fqdFjGXG3-HgXQsvD0gfauc,2577
177
- instaui/inject.py,sha256=NeTcsxoPdo12kZCvGjFU9NNHsVWnsPJfIcNY5_sPGYc,727
178
177
  instaui/js/__init__.py,sha256=oIYLPskHpQf8a4SWHLX4DyKjrlDrqWaqbNksIQsLBoA,69
179
178
  instaui/js/js_output.py,sha256=a4tZ99P19oen4510qI9LWX6pX0-lH5y37v8va6UY62Y,382
180
179
  instaui/js/lambda_func.py,sha256=ulCJ1lzF4h3jGihVTwltS3xEDPbTegjzIN8Al7U4Ank,1004
181
- instaui/launch_collector.py,sha256=_YmF3hsNWe-ZxMp_amqUBHkhB6fOuTPfX16BVwn25xg,1731
182
- instaui/page_info.py,sha256=aJtfLp2h05tCuLzxk2pZ6a9ztyxSdI-g3NBRxbqpS6E,269
183
180
  instaui/runtime/__init__.py,sha256=4aYTDsKaloRMQns8ttdfSx5xLmcN0Ot6tMqELbjIDZg,667
184
181
  instaui/runtime/_app.py,sha256=tF2rb_4SC6cMYTriDYUKRfroAK6tn5PFLEEXyogClmI,7340
185
182
  instaui/runtime/_inner_helper.py,sha256=Aw7S_KtCuOlpd8NP2RuQvNTL1GJtpxQGLsKdc3VXQFY,326
@@ -192,11 +189,10 @@ instaui/runtime/ui_state_scope.py,sha256=g48VpQj0BboooUrPr5VIWvcQoJe0bIQARMwRyVE
192
189
  instaui/settings/__init__.py,sha256=nK_xDrlq7CPjm9x3EKsKUW5qWBg_1d-xbqAp_i5G8cc,70
193
190
  instaui/settings/__settings.py,sha256=DWzRvs9bBqjoNA2MvGAyz3GRrSV8H6lMLF1H3iJyoyA,385
194
191
  instaui/shadcn_classless/_index.py,sha256=8gjLIh4J1ezFsQr3hvqS76gY_nhdgiNpexY-ENgfReY,1088
195
- instaui/shadcn_classless/static/shadcn-classless.css,sha256=3-DIG6JLQ5sZJekpxB2M3ZMgv4V5kBY7lcR6qZwgHuM,10473
196
- instaui/skip.py,sha256=uqhqusgeChVoivKFMoZd-XePYrlSoLvUzRZDBcUgFmA,149
192
+ instaui/shadcn_classless/static/shadcn-classless.css,sha256=ThJK_nVoBTOoyuz2I-w7dgUgXyZRI_HIupHgaz5Pl0Q,10876
197
193
  instaui/spa_router/__init__.py,sha256=DGSf0YD6wZFj22kmPSyJWUmm_Lx3_YFg32iOa096T7Y,519
198
194
  instaui/spa_router/_components.py,sha256=vPo4JuRtbD_5ll0LkGwU1p8l_pxNfCSdFLDzMXsoEpw,896
199
- instaui/spa_router/_file_base_utils.py,sha256=jcT9QoNu_ILhoI3JYhEA2JvINOg3PgWFa0d0IgysAa8,8697
195
+ instaui/spa_router/_file_base_utils.py,sha256=fdZJxi8h9oEf9olks4m-0rTe9Fqn7lq3uIDyFFt07xU,8805
200
196
  instaui/spa_router/_functions.py,sha256=6EDwXLHnmRrB_CUcbRNPblfOUPF8orob9PXrWm2RfSI,3227
201
197
  instaui/spa_router/_install.py,sha256=X9p7wtuGxo6B5F47UTY4ndOSRzENXkoK1XdkNo3F_YA,291
202
198
  instaui/spa_router/_route_model.py,sha256=x54tqunkVQSbBKpELiSwcDdBDUzDXFbJl_o6eSu7M7A,4057
@@ -206,17 +202,17 @@ instaui/spa_router/_router_param_var.py,sha256=KCy54xBZxGMqLO3Zlbzr6XV8ts-M6jCOK
206
202
  instaui/spa_router/_types.py,sha256=KuGuv5C6qivwllfdmV5qrvM0S_GWJ6u8OOTkCNmJImU,81
207
203
  instaui/spa_router/templates/page_routes,sha256=8VjM_8f6pjFb01QbU9z5HNqpcNRdCiX3X0OqNHLq8fo,1355
208
204
  instaui/static/insta-ui.css,sha256=9R3LRWKUiip75STPyqZzabt2vKqrYgmWyBZg8OeF02k,273
209
- instaui/static/insta-ui.esm-browser.prod.js,sha256=DbPvdWTQ3MK-U9uXB3gZrkrxagnEkrry33lfH4cS3PM,104663
205
+ instaui/static/insta-ui.esm-browser.prod.js,sha256=em5YZwr72ol2ffwseQ8hITW7-u0l2SCp5qLpoLv-Cx8,108453
210
206
  instaui/static/insta-ui.ico,sha256=08FJg4qWolvOjfodoh8IJLStslrvd8sDyuRcTUDq5ak,1150
211
- instaui/static/insta-ui.js.map,sha256=Ws0j4F0Y0p3FH8A8qhyCT3EVZUps6T76-C3tT87CjX4,658301
207
+ instaui/static/insta-ui.js.map,sha256=E0qAoNC50uX6FkepWhmkKTntXqHfa8tNL9yi6YDz1-s,658850
212
208
  instaui/static/instaui-tools-browser.js,sha256=cLHKNXYaYMZriMxV-yKGAHTrHSdNRUlDVZmv6uc6mMw,14455
213
- instaui/static/templates/debug/sse.html,sha256=qw5pzfjbU_XM-hA_SJCt2F8Imbvp17tW5l2dwoSZYjY,3391
214
- instaui/static/templates/web.html,sha256=pCHoQIPUO03GX_aZ5zNjRYQC9b0GPFtoYE9P8eo5pHc,1789
215
- instaui/static/templates/webview.html,sha256=9zQB7wkYKSgHh866Dk3xqSYbcWhCMCaVuh9iM8TFnhg,1862
216
- instaui/static/templates/zero.html,sha256=_PHhx6uYD__tlt_bXG4j1WoZGnMBXIs2w2sU6-1zvH4,1684
217
209
  instaui/static/vue.esm-browser.prod.js,sha256=vwQkXANuVYQuEFc0VgiokJdhNyMmvxMKyb1FmrYrNb4,162662
218
210
  instaui/static/vue.global.prod.js,sha256=xFm6fMjbZcmCWJ-l1kx_9HiHfo5bD9dWgyB87GpOieg,157924
219
211
  instaui/static/vue.runtime.esm-browser.prod.js,sha256=74FfP_s9pycfQXWAiGWx6SbjV_oJvMwZLFBkEXeW1Ek,102024
212
+ instaui/static/templates/web.html,sha256=pCHoQIPUO03GX_aZ5zNjRYQC9b0GPFtoYE9P8eo5pHc,1789
213
+ instaui/static/templates/webview.html,sha256=9zQB7wkYKSgHh866Dk3xqSYbcWhCMCaVuh9iM8TFnhg,1862
214
+ instaui/static/templates/zero.html,sha256=_PHhx6uYD__tlt_bXG4j1WoZGnMBXIs2w2sU6-1zvH4,1684
215
+ instaui/static/templates/debug/sse.html,sha256=qw5pzfjbU_XM-hA_SJCt2F8Imbvp17tW5l2dwoSZYjY,3391
220
216
  instaui/systems/file_system.py,sha256=q8k_mSHhldkSRYXT73T9s8zvERZZo9HL1U2-4mwau-I,163
221
217
  instaui/systems/func_system.py,sha256=iEnskq2vE4TUekJhMLc9hvv-iiougkxi1qXbvSEGovs,2806
222
218
  instaui/systems/js_system.py,sha256=t_r7SFPmfvTiIrxzuf1YgHyi_Oi_81W0UH_kkC5MwmM,685
@@ -231,7 +227,7 @@ instaui/template/__init__.py,sha256=fuua3uCOCmhWb7Q6Sc6pUxfwlxYJTXkdWB1V2fubyyc,
231
227
  instaui/template/_utils.py,sha256=wNIGDWr3z2PpmKsgShYISbCnII4AbKfsLIX_DRWlRbU,670
232
228
  instaui/template/env.py,sha256=ZqVsqpfSY1mupbgpBSkvOJytNui8xfNR5kNNC9rv4Ps,150
233
229
  instaui/template/web_template.py,sha256=BmZY13q4E_ZP4YVgfBKbbXvPHcGZfOl2f54wp_0DjJA,1603
234
- instaui/template/webview_template.py,sha256=AWDtsk-CbBOissWjIzjq-0gd8iVjKW7mjs70iGXmNcU,1629
230
+ instaui/template/webview_template.py,sha256=rd51iPi600QOPQ9PMjgYk61oIxn3L2p3_sJ3eBPG_24,1557
235
231
  instaui/template/zero_template.py,sha256=E88VGsyjb1qbHFJlMW-xmLRFkwUXZA7VDoZ_Jd8YubA,3514
236
232
  instaui/ui/__init__.py,sha256=giH6uvCsXsHh8TaUiyXI4eROFajVpYJM1NrLgVSQgoo,4173
237
233
  instaui/ui/__init__.pyi,sha256=NDj1z4wfqbImEAwaBic1115_AtuGLIcsiMkxPn_usA4,4077
@@ -248,13 +244,6 @@ instaui/vars/element_ref.py,sha256=qC-Kb1hBGz_Y6WKjKxRvYR8jdvWW4VeAAGzJ2wSrGgI,1
248
244
  instaui/vars/event_context.py,sha256=3ML6nyF6Q1hbFvdeu6E2QVOIVcWe1P9FtlCR0dgBGjo,1308
249
245
  instaui/vars/event_extend.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
246
  instaui/vars/js_computed.py,sha256=hZtU7XXmr1GAx118k9QyFWJnxpQPx5P7DWSfif2nfns,2712
251
- instaui/vars/mixin_types/common_type.py,sha256=4KduANLCUCeGTA1ClEsbFzEzd8Mgve3693Wxf9H7Gmw,176
252
- instaui/vars/mixin_types/element_binding.py,sha256=4suqqLT3zn5y7LvqVo2QrEgI1uUFS_5sv8vtTUCzkTc,235
253
- instaui/vars/mixin_types/observable.py,sha256=h2cox7BwQtLOWqCTaWnNU0TsgYJKuoNUuuEqwj-KXpU,141
254
- instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcntjxgums,302
255
- instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
256
- instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
257
- instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
258
247
  instaui/vars/path_var.py,sha256=DOgYHoajWKcMHMKYMSBiEOA99mmHIaMH-HRDvAKTZyE,2820
259
248
  instaui/vars/ref.py,sha256=iMwKRYI8ygy2cOpXJgqUYJCpzJCQskDl4lRYTACZWnA,2567
260
249
  instaui/vars/slot_prop.py,sha256=qBVQ0Ze0T8-Wsy__8qEuqVESIrLX69Bmy21Kuxrg_GQ,1198
@@ -262,24 +251,30 @@ instaui/vars/state.py,sha256=N6yLcVkiyCpK5oR8C2KbggFmLwpgBgzylp11JgFiab8,2630
262
251
  instaui/vars/types.py,sha256=K0QTajlzHaDvFoVMCHAhY_rVvrBm3FsC92BFPOgdBog,511
263
252
  instaui/vars/vfor_item.py,sha256=cVrpErh8OrycYjDLm7PTuE2kIcC2M6ThAQlwvTXG8x0,5490
264
253
  instaui/vars/vue_computed.py,sha256=6ZpxCQc2TJfh0vxTxcj6yNPjTVPo3CmsHq028xtiv8Y,2416
265
- instaui/vars/web_computed.py,sha256=JyWkCN3NHNCxp2QcSm3gRdgd64XOUG_zaLW6zABrFjY,4363
254
+ instaui/vars/web_computed.py,sha256=AshT-cwAugF_PPEKhgPz_IqtYozkWYQqDQQ6u96olVE,4558
266
255
  instaui/vars/web_view_computed.py,sha256=bFFVE9jRKczNy4HhmegWoC6KOL_Nrej-ag37DAIDzaA,36
267
- instaui/version.py,sha256=to8l16EjNe4jmzK316s5ZIotjv554tqF0VfwA1tBhQk,87
256
+ instaui/vars/mixin_types/common_type.py,sha256=4KduANLCUCeGTA1ClEsbFzEzd8Mgve3693Wxf9H7Gmw,176
257
+ instaui/vars/mixin_types/element_binding.py,sha256=4suqqLT3zn5y7LvqVo2QrEgI1uUFS_5sv8vtTUCzkTc,235
258
+ instaui/vars/mixin_types/observable.py,sha256=h2cox7BwQtLOWqCTaWnNU0TsgYJKuoNUuuEqwj-KXpU,141
259
+ instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcntjxgums,302
260
+ instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
261
+ instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
262
+ instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
268
263
  instaui/watch/_types.py,sha256=HJ_eAID0NsEJ_S8PhcYWxpVWhYLjjqKlbNWwqdqS4IU,73
269
264
  instaui/watch/_utils.py,sha256=mTITHG8hp0pyfQXUERQKXMDna5Au02bhuASCV32eXHI,124
270
265
  instaui/watch/js_watch.py,sha256=k9lgtyUGZ8a549QITcNie2kGbT0BJuYqfouoOex0Dqs,2182
271
266
  instaui/watch/vue_watch.py,sha256=Vd3nsRyf9ufrXLFTjaSvglwnkoWyE32fOV0qOogWPt4,2013
272
267
  instaui/watch/web_watch.py,sha256=6VOeXPHQM6UcCaOnrsZ-c5AiCNaUqL5nOkw4-G_2frE,3728
273
- instaui/webview/__init__.py,sha256=1yUBPkgYvuQk9cDYXzGE9WcUHyM0Af8Er632GtgQeuo,35
268
+ instaui/webview/__init__.py,sha256=_L8B0Ym7i1Q8eonQ81fC54EXn7oZuc6zE1KqeAEPHEg,65
274
269
  instaui/webview/_utils.py,sha256=pqARVv37h-8p7CLOpvqLV8O_az4EV2VD9G-beUVqjD8,172
275
270
  instaui/webview/api.py,sha256=9xuG3EKpmOOy1dvIrS9C9z9ukQDRnIdZLrGFD5FLyvU,2071
276
271
  instaui/webview/func.py,sha256=Igrf7U5qL5jJvhwIRJ3JqRjXxX_S2O_nQ9oy1HLFtYo,3422
277
- instaui/webview/index.py,sha256=0uUU2addq2Bu4Cb41iYSvVzLsJXWzzEI5vzb7rzIc0o,5821
272
+ instaui/webview/index.py,sha256=u-Q8ved3aPMyX_bDiGCq5HIafq80h4JP8Vd5__zP6-M,5806
278
273
  instaui/webview/resource.py,sha256=kFT6N5UZK5GLE0KmW3TrEYDNlViw9DL2OshRh41wBXs,5566
279
274
  instaui/zero/__init__.py,sha256=N0LuRUAcaurxHSspcEDuwZg62W2S3qL4VtrMKxOivBE,49
280
275
  instaui/zero/func.py,sha256=8cA_wJMtRmoAARjWY8yY5MmLXDAQ7hyVW6f1Vbejtoc,3576
281
276
  instaui/zero/scope.py,sha256=HGohYOqnpRGVkkoz_gvR6-DgCc48AtJAcDwbOnnGHLM,3753
282
- instaui-0.1.8.dist-info/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
283
- instaui-0.1.8.dist-info/METADATA,sha256=QOxw5WEHpeqJoc9PIg1YNwHFTVpfI90-KmAQImYlF00,3758
284
- instaui-0.1.8.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
285
- instaui-0.1.8.dist-info/RECORD,,
277
+ instaui-0.1.9.dist-info/METADATA,sha256=H__7zKHpdSdcVnoo2stzox5GGrrhFnrAGx6VNIV3p8M,3399
278
+ instaui-0.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
279
+ instaui-0.1.9.dist-info/licenses/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
280
+ instaui-0.1.9.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,3 +0,0 @@
1
- __all__ = ["duckdb"]
2
-
3
- from ._duckdb import _facade as duckdb
@@ -1,23 +0,0 @@
1
- from instaui import ui
2
- from ._types import TFilters
3
-
4
-
5
- class DataSourceElement(ui.element, esm="./data_source.js"):
6
- def __init__(
7
- self,
8
- ):
9
- super().__init__()
10
-
11
- self._ele_ref = ui.element_ref()
12
- self.element_ref(self._ele_ref)
13
-
14
- self.filters: TFilters = ui.state({})
15
-
16
- self.on(
17
- "filter-changed",
18
- ui.js_event(
19
- inputs=[ui.event_context.e()],
20
- outputs=[self.filters],
21
- code="v=> v.filters",
22
- ),
23
- )
@@ -1,221 +0,0 @@
1
- from pathlib import Path
2
- from typing import Dict, TypeVar
3
- import itertools
4
- from instaui import ui, arco
5
- from ._base import DataSourceElement
6
- from ._types import TFilters, TQueryStrInfo
7
-
8
- try:
9
- import pandas
10
- import duckdb
11
- except ImportError as e:
12
- raise e
13
-
14
-
15
- TElementClass = TypeVar("TElementClass", bound=ui.element)
16
-
17
-
18
- class DuckdbDataFrameSource:
19
- QUERY_ID: int = 0
20
-
21
- def __init__(
22
- self,
23
- table_name: str,
24
- ):
25
- super().__init__()
26
-
27
- self._element = DataSourceElement()
28
- self._conn = duckdb.connect(":default:", read_only=False)
29
- self._table_name = table_name
30
-
31
- def _generate_query_id(self):
32
- self.QUERY_ID += 1
33
- return self.QUERY_ID
34
-
35
- def __getitem__(self, field: str):
36
- def use_fn(cls: type[TElementClass]) -> TElementClass:
37
- if issubclass(cls, arco.select):
38
- return self.__apply_select(field)(cls)
39
-
40
- if issubclass(cls, arco.input):
41
- return self.__apply_input(field)(cls)
42
-
43
- raise NotImplementedError(f"Not supported component:{cls.__name__}")
44
-
45
- return use_fn
46
-
47
- def __query_distinct_field_values(
48
- self, field: str, query_id: int, order_sql: str = ""
49
- ):
50
- @ui.computed(inputs=[self.__query_str_info(field, query_id), field, order_sql])
51
- def query_distinct_field_values_computed(
52
- with_filters_info: TQueryStrInfo, field: str, order_sql: str
53
- ):
54
- sql = f"with cte as ({with_filters_info['sql']}) select distinct {field} from cte {order_sql}"
55
-
56
- local_con = self._conn.cursor()
57
-
58
- query = local_con.sql(sql, params=with_filters_info["params"])
59
- return list(itertools.chain(*query.fetchall()))
60
-
61
- return query_distinct_field_values_computed
62
-
63
- def __apply_select(self, field: str):
64
- def use_fn(cls: type[arco.select]) -> arco.select:
65
- query_id = self._generate_query_id()
66
- element = cls(
67
- self.__query_distinct_field_values(
68
- field=field, query_id=query_id, order_sql=f"order by {field}"
69
- )
70
- )
71
-
72
- on_change = ui.js_event(
73
- inputs=[ui.event_context.e(), field, query_id],
74
- outputs=[self._element._ele_ref],
75
- code=r"""(value,field,query_id) => {
76
- if (value) {
77
- return {method: 'addFilter', args:[{field, expr: `${field}= ?`,value,query_id}]};
78
- }
79
-
80
- return {method:'removeFilter', args:[{field,query_id}]};
81
- }""",
82
- )
83
-
84
- element.on_change(on_change)
85
-
86
- return element
87
-
88
- return use_fn
89
-
90
- def __apply_input(self, field: str):
91
- def use_fn(cls: type[arco.input]) -> arco.input:
92
- query_id = self._generate_query_id()
93
- element = cls()
94
-
95
- on_change = ui.js_event(
96
- inputs=[ui.event_context.e(), field, query_id],
97
- outputs=[self._element._ele_ref],
98
- code=r"""(value,field,query_id) => {
99
- if (value) {
100
- value = `%${value.trim()}%`
101
- return {method: 'addFilter', args:[{field, expr: `${field} like ?`,value,replace:true,query_id}]};
102
- }
103
-
104
- return {method:'removeFilter', args:[{field,query_id}]};
105
- }""",
106
- )
107
-
108
- element.on_input(on_change)
109
-
110
- return element
111
-
112
- return use_fn
113
-
114
- def __query_str_info(self, target_field: str = "", query_id: int = -1):
115
- @ui.computed(inputs=[self._element.filters, target_field, query_id])
116
- def query_str_computed(filters: TFilters, target_field: str, query_id: int):
117
- if not filters:
118
- return {
119
- "sql": f"select * from {self._table_name}",
120
- "params": [],
121
- }
122
- else:
123
- filter_exprs = []
124
-
125
- if target_field:
126
- target_key = f"{target_field}-{query_id}"
127
- without_target_exprs = (
128
- exprs for key, exprs in filters.items() if key != target_key
129
- )
130
- filter_exprs = list(itertools.chain(*without_target_exprs))
131
- else:
132
- filter_exprs = list(itertools.chain(*filters.values()))
133
-
134
- where_stem = " and ".join(info["expr"] for info in filter_exprs)
135
- if where_stem:
136
- where_stem = f" where {where_stem}"
137
- return {
138
- "sql": f"select * from {self._table_name}{where_stem}",
139
- "params": [info["value"] for info in filter_exprs],
140
- }
141
-
142
- return query_str_computed
143
-
144
- def query_str(self):
145
- return ui.js_computed(
146
- inputs=[self.__query_str_info()],
147
- code=r"""info=>{
148
- const {sql,params} = info;
149
- let currentIndex = 0;
150
- return sql.replace(/\?/g, function () {
151
- if (currentIndex >= params.length) {
152
- throw new Error('Not enough parameters provided for the SQL statement.');
153
- }
154
- return JSON.stringify(params[currentIndex++]);
155
- });
156
- }""",
157
- )
158
-
159
- def filters(self):
160
- return self._element.filters
161
-
162
- def __apply_table(self, *, sql: str):
163
- def use_fn(cls: type[arco.table]) -> arco.table:
164
- @ui.computed(inputs=[self.__query_str_info(), sql])
165
- def table_query(with_filters_into: TQueryStrInfo, sql: str):
166
- sql = f"with cte as ({with_filters_into['sql']}) {sql}"
167
-
168
- local_con = self._conn.cursor()
169
-
170
- query = local_con.sql(sql, params=with_filters_into["params"])
171
- columns = query.columns
172
- values = query.fetchall()
173
-
174
- real_cols = [{"title": col, "dataIndex": col} for col in columns]
175
-
176
- real_values = [
177
- {col: val for col, val in zip(columns, row)} for row in values
178
- ]
179
-
180
- return {
181
- "columns": real_cols,
182
- "data": real_values,
183
- }
184
-
185
- element = cls(
186
- data=ui.js_computed(inputs=[table_query], code=r"v=> v ? v.data : []"),
187
- columns=ui.js_computed(
188
- inputs=[table_query], code=r"v=> v ? v.columns : []"
189
- ),
190
- )
191
-
192
- return element
193
-
194
- return use_fn
195
-
196
- def __call__(self, cls: type[arco.table], *, sql: str = "select * from cte"):
197
- return self.__apply_table(sql=sql)(cls)
198
-
199
- def query_table(self, *, sql: str):
200
- return self.__apply_table(sql=sql)
201
-
202
-
203
- class Facade:
204
- def __call__(self, db: Path):
205
- self.db = db
206
- raise NotImplementedError()
207
-
208
- @classmethod
209
- def from_pandas(
210
- cls, dataframe: "pandas.DataFrame", *, table_name: str = "df"
211
- ) -> DuckdbDataFrameSource:
212
- ds = DuckdbDataFrameSource(table_name)
213
-
214
- cursor = ds._conn.cursor()
215
- cursor.execute(
216
- f"create table if not exists {table_name} as select * from dataframe"
217
- )
218
- return ds
219
-
220
-
221
- _facade = Facade()
@@ -1,15 +0,0 @@
1
- from typing import Any, Dict, List
2
- from typing_extensions import TypedDict
3
-
4
-
5
- class TFilterInfo(TypedDict):
6
- expr: str
7
- value: Any
8
-
9
-
10
- TFilters = Dict[str, List[TFilterInfo]]
11
-
12
-
13
- class TQueryStrInfo(TypedDict):
14
- sql: str
15
- params: List[Any]