seraplot 2.8.8__cp310-cp310-win_amd64.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.
seraplot/__init__.py ADDED
@@ -0,0 +1,383 @@
1
+ from .seraplot import (
2
+ Chart,
3
+ Canvas,
4
+ canvas,
5
+ canvas_load,
6
+ canvas_save_named,
7
+ canvas_load_named,
8
+ canvas_default_dir,
9
+ Dataset,
10
+ DatasetStats,
11
+ Table,
12
+ SeraDFrame,
13
+ DFrameBuilder,
14
+ LiveStream,
15
+ theme,
16
+ config as _config_fn,
17
+ _sera_call,
18
+ _sera_call_fast,
19
+ _sera_list,
20
+ _sera_aliases,
21
+ _alias_add,
22
+ _alias_remove,
23
+ _alias_reset,
24
+ _alias_list_json,
25
+ _alias_resolve,
26
+ _themes as themes,
27
+ _reset_theme as reset_theme,
28
+ _set_global_background as set_background,
29
+ _reset_global_background as reset_background,
30
+ _set_global_background as set_global_background,
31
+ _reset_global_background as reset_global_background,
32
+ _set_auto_display as set_auto_display,
33
+ _reset_config as reset_config,
34
+ _demos as demos,
35
+ _demo as demo,
36
+ _params_json,
37
+ _required_params_json,
38
+ _true_required_params_json,
39
+ _chart_variants_json,
40
+ _chart_themes_json,
41
+ _map_regions_json,
42
+ _region_labels_json,
43
+ _scenes3d_json,
44
+ _docs_json,
45
+ _chart_methods_json,
46
+ chart_info,
47
+ bind_colors,
48
+ clear_color_bindings,
49
+ __version__,
50
+ )
51
+
52
+ try:
53
+ from .seraplot import App
54
+ except ImportError:
55
+ App = None
56
+
57
+ try:
58
+ from .seraplot import serve_board, export_board_html
59
+ except ImportError:
60
+ serve_board = None
61
+ export_board_html = None
62
+
63
+ try:
64
+ from .seraplot import (
65
+ pulse_activate,
66
+ pulse_status,
67
+ pulse_machine_id,
68
+ pulse_health,
69
+ pulse_serve_health,
70
+ pulse_serve_metrics,
71
+ )
72
+ except ImportError:
73
+ pulse_activate = None
74
+ pulse_status = None
75
+ pulse_machine_id = None
76
+ pulse_health = None
77
+ pulse_serve_health = None
78
+ pulse_serve_metrics = None
79
+
80
+ try:
81
+ from .seraplot import SecureDFrame, SecureDFrameBuilder, SeraKey
82
+ except ImportError:
83
+ SecureDFrame = None
84
+ SecureDFrameBuilder = None
85
+ SeraKey = None
86
+
87
+ try:
88
+ from .seraplot import export_pdf_report
89
+ except ImportError:
90
+ export_pdf_report = None
91
+
92
+ try:
93
+ from .seraplot import SeraDFrameGroupBy
94
+ except ImportError:
95
+ SeraDFrameGroupBy = None
96
+
97
+ import json as _json
98
+ from functools import lru_cache, singledispatch, singledispatchmethod
99
+
100
+
101
+ @lru_cache(maxsize=None)
102
+ def _params_json_cached(chart, variant):
103
+ return _params_json(chart, variant)
104
+
105
+
106
+ @lru_cache(maxsize=None)
107
+ def _required_params_json_cached(chart, variant):
108
+ return _required_params_json(chart, variant)
109
+
110
+
111
+ @lru_cache(maxsize=None)
112
+ def _true_required_params_json_cached(chart, variant):
113
+ return _true_required_params_json(chart, variant)
114
+
115
+
116
+ @lru_cache(maxsize=1)
117
+ def _chart_variants_json_cached():
118
+ return _chart_variants_json()
119
+
120
+
121
+ @lru_cache(maxsize=1)
122
+ def _chart_themes_json_cached():
123
+ return _chart_themes_json()
124
+
125
+
126
+ @lru_cache(maxsize=1)
127
+ def _map_regions_json_cached():
128
+ return _map_regions_json()
129
+
130
+
131
+ @lru_cache(maxsize=None)
132
+ def _region_labels_json_cached(map, group):
133
+ return _region_labels_json(map, group)
134
+
135
+
136
+ @lru_cache(maxsize=1)
137
+ def _scenes3d_json_cached():
138
+ return _scenes3d_json()
139
+
140
+
141
+ @lru_cache(maxsize=1)
142
+ def _docs_json_cached():
143
+ return _docs_json()
144
+
145
+
146
+ @lru_cache(maxsize=1)
147
+ def _chart_methods_json_cached():
148
+ return _chart_methods_json()
149
+
150
+
151
+ def params(chart=None, variant=None):
152
+ return _json.loads(_params_json_cached(chart, variant))
153
+
154
+
155
+ def required_params(chart=None, variant=None):
156
+ return _json.loads(_required_params_json_cached(chart, variant))
157
+
158
+
159
+ def true_required_params(chart=None, variant=None):
160
+ return _json.loads(_true_required_params_json_cached(chart, variant))
161
+
162
+
163
+ def chart_variants():
164
+ return _json.loads(_chart_variants_json_cached())
165
+
166
+
167
+ def chart_themes():
168
+ return _json.loads(_chart_themes_json_cached())
169
+
170
+
171
+ def map_regions():
172
+ return _json.loads(_map_regions_json_cached())
173
+
174
+
175
+ def region_labels(map=None, group=None):
176
+ return _json.loads(_region_labels_json_cached(map, group))
177
+
178
+
179
+ def scenes3d():
180
+ return _json.loads(_scenes3d_json_cached())
181
+
182
+
183
+ def docs():
184
+ return _json.loads(_docs_json_cached())
185
+
186
+
187
+ def chart_methods():
188
+ return _json.loads(_chart_methods_json_cached())
189
+
190
+
191
+ def _json_ready(value):
192
+ if isinstance(value, Chart):
193
+ return value.html
194
+ if isinstance(value, (list, tuple)):
195
+ return [_json_ready(v) for v in value]
196
+ if isinstance(value, dict):
197
+ return {k: _json_ready(v) for k, v in value.items()}
198
+ if hasattr(value, "tolist"):
199
+ return value.tolist()
200
+ return value
201
+
202
+
203
+ @singledispatch
204
+ def _coerce_call_args(first, kwargs):
205
+ kwargs.setdefault("title", first)
206
+ return kwargs
207
+
208
+
209
+ @_coerce_call_args.register(list)
210
+ @_coerce_call_args.register(tuple)
211
+ def _(first, kwargs):
212
+ if "charts" not in kwargs:
213
+ kwargs["charts"] = list(first)
214
+ return kwargs
215
+
216
+
217
+ @_coerce_call_args.register(dict)
218
+ def _(first, kwargs):
219
+ merged = dict(first)
220
+ merged.update(kwargs)
221
+ return merged
222
+
223
+
224
+ _NATIVE_PUSH_BUILDERS = frozenset({
225
+ "build_bar",
226
+ "build_heatmap",
227
+ "build_candlestick",
228
+ "build_icicle",
229
+ "build_line",
230
+ "build_line_chart",
231
+ "build_area_chart",
232
+ "build_scatter_chart",
233
+ "build_bubble",
234
+ })
235
+
236
+
237
+ def _make_fn(name):
238
+ native = name in _NATIVE_PUSH_BUILDERS
239
+
240
+ def _fn(*args, **kwargs):
241
+ if args:
242
+ kwargs = _coerce_call_args(args[0], kwargs)
243
+ kwargs = {k: _json_ready(v) for k, v in kwargs.items()}
244
+ if native:
245
+ title = kwargs.pop("title", "") or ""
246
+ labels = kwargs.pop("labels", None)
247
+ values = kwargs.pop("values", None)
248
+ theme = kwargs.pop("theme", None)
249
+ result = _sera_call_fast(name, title, labels, values, theme, **kwargs)
250
+ else:
251
+ result = _sera_call(name, _json.dumps(kwargs))
252
+ stripped = result.lstrip()
253
+ if stripped.startswith("{") or stripped.startswith("["):
254
+ try:
255
+ return _json.loads(result)
256
+ except ValueError:
257
+ raise ValueError(f"Failed to parse JSON result from {name!r}: {result!r}")
258
+ return Chart(result)
259
+ _fn.__name__ = name
260
+ _fn.__qualname__ = name
261
+ return _fn
262
+
263
+ _alias_map = dict(_sera_aliases())
264
+
265
+ for _n in _sera_list():
266
+ globals()[_n] = _make_fn(_n)
267
+
268
+ for _alias, _target in _alias_map.items():
269
+ if _alias not in globals() and _target in globals():
270
+ globals()[_alias] = globals()[_target]
271
+
272
+ del _make_fn, _alias_map, _n, _alias, _target
273
+
274
+
275
+ import os as _os
276
+
277
+
278
+ def _default_visual_config_path():
279
+ return _os.path.join(_os.path.expanduser("~"), ".seraplot", "config.json")
280
+
281
+
282
+ @lru_cache(maxsize=1)
283
+ def _alias_list_json_cached():
284
+ return _alias_list_json()
285
+
286
+
287
+ class _ConfigProxy:
288
+ def __init__(self):
289
+ self._state = {}
290
+
291
+ def __call__(self, *args, **kwargs):
292
+ result = _config_fn(*args, **kwargs)
293
+ self._state.update(kwargs)
294
+ return result
295
+
296
+ @property
297
+ def aliases(self):
298
+ return _json.loads(_alias_list_json_cached())
299
+
300
+ @singledispatchmethod
301
+ def add(self, spec, alias=None):
302
+ raise TypeError(f"config.add() does not support {type(spec).__name__!r}")
303
+
304
+ @add.register
305
+ def _(self, spec: str, alias=None):
306
+ return self.add_alias(spec, alias)
307
+
308
+ @add.register
309
+ def _(self, spec: dict, alias=None):
310
+ return self.add_aliases(spec)
311
+
312
+ def add_alias(self, method_name, alias):
313
+ for a in ([alias] if isinstance(alias, str) else alias):
314
+ _alias_add(method_name, a)
315
+ _alias_list_json_cached.cache_clear()
316
+ return self
317
+
318
+ def add_aliases(self, mapping):
319
+ for method_name, alias in dict(mapping).items():
320
+ self.add_alias(method_name, alias)
321
+ return self
322
+
323
+ def remove_alias(self, method_name, alias):
324
+ _alias_remove(method_name, alias)
325
+ _alias_list_json_cached.cache_clear()
326
+ return self
327
+
328
+ def reset(self):
329
+ _alias_reset()
330
+ _alias_list_json_cached.cache_clear()
331
+ return self
332
+
333
+ def save(self, path=None):
334
+ target = path or _default_visual_config_path()
335
+ _os.makedirs(_os.path.dirname(target) or ".", exist_ok=True)
336
+ payload = {"visual": self._state, "aliases": self.aliases}
337
+ with open(target, "w", encoding="utf-8") as f:
338
+ _json.dump(payload, f, indent=2)
339
+ return target
340
+
341
+ def load(self, path=None):
342
+ target = path or _default_visual_config_path()
343
+ try:
344
+ with open(target, "r", encoding="utf-8") as f:
345
+ payload = _json.load(f)
346
+ except FileNotFoundError:
347
+ return False
348
+ visual = payload.get("visual", {})
349
+ if visual:
350
+ _config_fn(**visual)
351
+ self._state.update(visual)
352
+ for method_name, alias_list in payload.get("aliases", {}).items():
353
+ self.add_alias(method_name, alias_list)
354
+ return True
355
+
356
+
357
+ config = _ConfigProxy()
358
+
359
+
360
+ def save_config(path=None):
361
+ return config.save(path)
362
+
363
+
364
+ def load_config(path=None):
365
+ return config.load(path)
366
+
367
+
368
+ config.load()
369
+
370
+
371
+ def fetch_image(url: str) -> str:
372
+ import urllib.request as _ur, base64 as _b64, mimetypes as _mt
373
+ with _ur.urlopen(url) as resp:
374
+ data = resp.read()
375
+ ct = resp.headers.get_content_type() or _mt.guess_type(url)[0] or "image/jpeg"
376
+ return "data:" + ct + ";base64," + _b64.b64encode(data).decode()
377
+
378
+
379
+ def __getattr__(name):
380
+ target = _alias_resolve(name)
381
+ if target is not None and target in globals():
382
+ return globals()[target]
383
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: seraplot/seraplot.cp310-win_amd64.pyd
3
+ size: 46821376 bytes
4
+ sha256: 65c0f8a8aea716626e05987ad1aaa52d1aa7a9b397bc59ea987392c8fcb06833
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: seraplot
3
+ Version: 2.8.8
4
+ Requires-Dist: numpy
5
+ License-File: LICENSE
6
+ Summary: Rust data visualization framework - The modern Plotly alternative
7
+ Home-Page: https://feur25.github.io/Sera/getting-started/intro-seraplot.html
8
+ Author-email: Quentin <feur09@gmail.com>
9
+ License: MIT
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
+ Project-URL: Documentation, https://feur25.github.io/Sera/
13
+ Project-URL: Homepage, https://feur25.github.io/Sera/getting-started/intro-seraplot.html
14
+ Project-URL: Issues, https://github.com/feur25/Sera/issues
15
+ Project-URL: Repository, https://github.com/feur25/Sera
16
+
17
+ SeraPlot — High-Performance Data Visualization Framework
18
+
19
+ **SeraPlot v2.8.0+** is a Rust-native charting library exposed to Python as a single compiled extension — no JavaScript charting library, no Node toolchain, no external rendering service. One `pip install` gets you 60+ chart types across 2D, 3D, and maps, a small canvas drawing API for custom compositions, and `sp.App` — a reactive dashboard server built directly into the core, no Flask or Dash required.
20
+
21
+ Every chart renders to a single self-contained HTML file — no CDN, no backend, works offline or embedded anywhere a browser can open a file.
22
+
23
+ > **Documentation:** https://feur25.github.io/Sera/getting-started/intro-seraplot.html
24
+
25
+ ---
26
+
27
+ ## Installation
28
+
29
+ **Python** (PyPI — wheel for CPython 3.8+, Windows/Linux/macOS)
30
+
31
+ ```bash
32
+ pip install seraplot
33
+ ```
34
+
35
+ Other package managers:
36
+
37
+ ```bash
38
+ conda install -c conda-forge seraplot
39
+ uv pip install seraplot
40
+ ```
41
+
42
+ **JavaScript/WebAssembly** (npm)
43
+
44
+ ```bash
45
+ npm install seraplot
46
+ ```
47
+
48
+ **Quickstart**
49
+
50
+ ```python
51
+ import seraplot as sp
52
+
53
+ chart = sp.bar("Revenue by Product", labels=["A", "B", "C"], values=[42, 68, 35])
54
+ chart.save("chart.html")
55
+ ```
56
+
57
+ Open `chart.html` in any browser — no server, no build step.
58
+
59
+ ---
60
+
61
+ ### Gallery — Chart Types
62
+
63
+ #### 2D Charts
64
+ | | | | |
65
+ |:---:|:---:|:---:|:---:|
66
+ | ![2D-1](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/1.png) | ![2D-2](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/2.png) | ![2D-3](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/3.png) | ![2D-4](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/4.png) |
67
+ | ![2D-5](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/5.png) | ![2D-6](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/6.png) | ![2D-7](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/7.png) | ![2D-8](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/8.png) |
68
+
69
+ #### 3D Charts
70
+ | | | | |
71
+ |:---:|:---:|:---:|:---:|
72
+ | ![3D-1](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/1.png) | ![3D-2](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/2.png) | ![3D-3](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/3.png) | ![3D-4](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/4.png) |
73
+ | ![3D-5](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/5.png) | ![3D-6](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/6.png) | ![3D-7](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/7.png) | ![3D-8](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/8.png) |
74
+
75
+ ---
76
+ <p align="center">
77
+ <a href="https://feur25.github.io/Sera/getting-started/intro-seraplot.html"><img src="https://i.ibb.co/WpF73657/logo-banner.png" alt="Seraplot Banner" border="0"></a>
78
+ </p>
79
+
@@ -0,0 +1,7 @@
1
+ seraplot/__init__.py,sha256=6GHUj0TC3DCHHMjSKcsUX3VhpFpBe0nDnWjcXL9DBnA,9804
2
+ seraplot/seraplot.cp310-win_amd64.pyd,sha256=ZcD4qK6nFmJuBZh60aqlLRqnqbOXvFnqmHOSyPywaDM,46821376
3
+ seraplot-2.8.8.dist-info/METADATA,sha256=J_hkGTAG-vhtEAHPUTtb8m0nvoeAdSB0aRQapA0ONx8,3709
4
+ seraplot-2.8.8.dist-info/WHEEL,sha256=2nikx46IirIvKSYVlhRjNzbJg72B0NvIUOuhVphsMOs,97
5
+ seraplot-2.8.8.dist-info/licenses/LICENSE,sha256=_hQWUSXjczZkBoh3Ch6x_7h2EUU2i-Qo4CrRoVe7QBE,1086
6
+ seraplot-2.8.8.dist-info/sboms/seraplot.cyclonedx.json,sha256=74qA8ESr8Izyo05ZnjUtyuham-92ci062griVJlhaNE,367396
7
+ seraplot-2.8.8.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FeurKing
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.