tkipw 0.0.1__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.
tkipw/__init__.py ADDED
@@ -0,0 +1,89 @@
1
+ """tkipw — ipywidgets / anywidget runtime on tkwry."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .app import App, Runtime
6
+ from .comm_backend import (
7
+ install_comm_backend,
8
+ uninstall_comm_backend,
9
+ )
10
+ from .display_mode import get_display_mode, set_display_mode
11
+ from .jupyter import (
12
+ JupyterExtension,
13
+ enable_extension,
14
+ get_extension,
15
+ install_jupyter_support,
16
+ register_extension,
17
+ uninstall_jupyter_support,
18
+ )
19
+ from .output import (
20
+ Output,
21
+ clear_output,
22
+ display,
23
+ display_error,
24
+ to_widget,
25
+ )
26
+
27
+ # Install as early as possible so widgets created after ``import tkipw``
28
+ # use TkwryComm instead of DummyComm.
29
+ install_comm_backend()
30
+
31
+ __all__ = [
32
+ "App",
33
+ "Runtime",
34
+ "Output",
35
+ "clear_output",
36
+ "display",
37
+ "display_error",
38
+ "to_widget",
39
+ "get_display_mode",
40
+ "set_display_mode",
41
+ "install_comm_backend",
42
+ "uninstall_comm_backend",
43
+ "JupyterExtension",
44
+ "register_extension",
45
+ "enable_extension",
46
+ "get_extension",
47
+ "install_jupyter_support",
48
+ "uninstall_jupyter_support",
49
+ "enable_matplotlib",
50
+ "matplotlib_inline",
51
+ "matplotlib_window",
52
+ "enable_pyvista",
53
+ "enable_pillow",
54
+ "enable_altair",
55
+ "enable_bokeh",
56
+ ]
57
+ __version__ = "0.0.1"
58
+
59
+
60
+ def __getattr__(name: str):
61
+ if name in ("enable_matplotlib", "matplotlib_inline", "matplotlib_window"):
62
+ from .extensions.matplotlib import (
63
+ enable_matplotlib,
64
+ matplotlib_inline,
65
+ matplotlib_window,
66
+ )
67
+
68
+ return {
69
+ "enable_matplotlib": enable_matplotlib,
70
+ "matplotlib_inline": matplotlib_inline,
71
+ "matplotlib_window": matplotlib_window,
72
+ }[name]
73
+ if name == "enable_pyvista":
74
+ from .extensions.pyvista import enable_pyvista
75
+
76
+ return enable_pyvista
77
+ if name == "enable_pillow":
78
+ from .extensions.pillow import enable_pillow
79
+
80
+ return enable_pillow
81
+ if name == "enable_altair":
82
+ from .extensions.altair import enable_altair
83
+
84
+ return enable_altair
85
+ if name == "enable_bokeh":
86
+ from .extensions.bokeh import enable_bokeh
87
+
88
+ return enable_bokeh
89
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")