staticdash 2025.28__tar.gz → 2025.30__tar.gz

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.
Files changed (26) hide show
  1. {staticdash-2025.28 → staticdash-2025.30}/PKG-INFO +1 -1
  2. {staticdash-2025.28 → staticdash-2025.30}/pyproject.toml +8 -2
  3. staticdash-2025.30/setup.py +77 -0
  4. staticdash-2025.30/staticdash/assets/vendor/mathjax/tex-mml-chtml.js +1 -0
  5. staticdash-2025.30/staticdash/assets/vendor/plotly/plotly.min.js +8 -0
  6. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-bash.min.js +1 -0
  7. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-c.min.js +1 -0
  8. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-javascript.min.js +1 -0
  9. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-json.min.js +1 -0
  10. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-markup.min.js +1 -0
  11. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-python.min.js +1 -0
  12. staticdash-2025.30/staticdash/assets/vendor/prism/components/prism-sql.min.js +1 -0
  13. staticdash-2025.30/staticdash/assets/vendor/prism/prism-tomorrow.min.css +1 -0
  14. staticdash-2025.30/staticdash/assets/vendor/prism/prism.min.js +16 -0
  15. {staticdash-2025.28 → staticdash-2025.30}/staticdash/dashboard.py +32 -28
  16. {staticdash-2025.28 → staticdash-2025.30}/staticdash.egg-info/PKG-INFO +1 -1
  17. staticdash-2025.30/staticdash.egg-info/SOURCES.txt +23 -0
  18. staticdash-2025.28/staticdash.egg-info/SOURCES.txt +0 -11
  19. {staticdash-2025.28 → staticdash-2025.30}/README.md +0 -0
  20. {staticdash-2025.28 → staticdash-2025.30}/setup.cfg +0 -0
  21. {staticdash-2025.28 → staticdash-2025.30}/staticdash/__init__.py +0 -0
  22. {staticdash-2025.28 → staticdash-2025.30}/staticdash/assets/css/style.css +0 -0
  23. {staticdash-2025.28 → staticdash-2025.30}/staticdash/assets/js/script.js +0 -0
  24. {staticdash-2025.28 → staticdash-2025.30}/staticdash.egg-info/dependency_links.txt +0 -0
  25. {staticdash-2025.28 → staticdash-2025.30}/staticdash.egg-info/requires.txt +0 -0
  26. {staticdash-2025.28 → staticdash-2025.30}/staticdash.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staticdash
3
- Version: 2025.28
3
+ Version: 2025.30
4
4
  Summary: A lightweight static HTML dashboard generator with Plotly and pandas support.
5
5
  Author-email: Brian Day <brian.day1@gmail.com>
6
6
  License: CC0-1.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "staticdash"
7
- version = "2025.28"
7
+ version = "2025.30"
8
8
  description = "A lightweight static HTML dashboard generator with Plotly and pandas support."
9
9
  authors = [
10
10
  { name = "Brian Day", email = "brian.day1@gmail.com" }
@@ -25,7 +25,13 @@ dependencies = [
25
25
  packages = ["staticdash"]
26
26
 
27
27
  [tool.setuptools.package-data]
28
- staticdash = ["assets/css/*.css", "assets/js/*.js"]
28
+ staticdash = [
29
+ "assets/css/*.css",
30
+ "assets/js/*.js",
31
+ "assets/vendor/*",
32
+ "assets/vendor/**/*"
33
+ ]
34
+
29
35
 
30
36
  [project.urls]
31
37
  Homepage = "https://github.com/staticdash/staticdash"
@@ -0,0 +1,77 @@
1
+ # setup.py
2
+ from setuptools import setup
3
+ from setuptools.command.build_py import build_py as _build_py
4
+ from pathlib import Path
5
+ import os
6
+ import shutil
7
+ import urllib.request
8
+
9
+ # Where your repo assets live
10
+ REPO_ASSETS = Path("staticdash/assets")
11
+ VENDOR_DIR = REPO_ASSETS / "vendor"
12
+
13
+ # Simple cache dir (respects XDG if set)
14
+ CACHE_DIR = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")) / "staticdash"
15
+ CACHE_DIR.mkdir(parents=True, exist_ok=True)
16
+
17
+ # If you need to force “no network” builds in CI:
18
+ # STATICDASH_VENDOR_OFFLINE=1 -> require the files to already be in the cache
19
+ OFFLINE = os.environ.get("STATICDASH_VENDOR_OFFLINE", "0") == "1"
20
+
21
+ # (relative path under vendor, url)
22
+ VENDOR_FILES = [
23
+ ("plotly/plotly.min.js", "https://cdn.plot.ly/plotly-2.32.0.min.js"),
24
+ ("mathjax/tex-mml-chtml.js", "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"),
25
+ ("prism/prism-tomorrow.min.css", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism-tomorrow.min.css"),
26
+ ("prism/prism.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js"),
27
+ ("prism/components/prism-python.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"),
28
+ ("prism/components/prism-javascript.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.min.js"),
29
+ ("prism/components/prism-sql.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.min.js"),
30
+ ("prism/components/prism-markup.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.min.js"),
31
+ ("prism/components/prism-bash.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.min.js"),
32
+ ("prism/components/prism-json.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-json.min.js"),
33
+ ("prism/components/prism-c.min.js", "https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-c.min.js"),
34
+ ]
35
+
36
+ def _cache_path(rel: str) -> Path:
37
+ return CACHE_DIR / rel
38
+
39
+ def _ensure_file(rel: str, url: str) -> Path:
40
+ """
41
+ Return a path to the cached file; download if missing (unless OFFLINE).
42
+ """
43
+ cpath = _cache_path(rel)
44
+ if cpath.exists():
45
+ return cpath
46
+ if OFFLINE:
47
+ raise RuntimeError(f"[staticdash] Missing cached asset (offline): {cpath}")
48
+ cpath.parent.mkdir(parents=True, exist_ok=True)
49
+ print(f"[staticdash] caching {url} -> {cpath}")
50
+ urllib.request.urlretrieve(url, cpath)
51
+ return cpath
52
+
53
+ def _vendorize():
54
+ """
55
+ Populate staticdash/assets/vendor/ from the cache (downloading if needed).
56
+ Also ensure css/js folders exist (no changes to your actual code).
57
+ """
58
+ # Make sure base asset dirs exist in the repo (harmless if already present)
59
+ (REPO_ASSETS / "css").mkdir(parents=True, exist_ok=True)
60
+ (REPO_ASSETS / "js").mkdir(parents=True, exist_ok=True)
61
+ # (no content changes to your css/js; we just avoid build errors if missing)
62
+
63
+ VENDOR_DIR.mkdir(parents=True, exist_ok=True)
64
+ for rel, url in VENDOR_FILES:
65
+ src = _ensure_file(rel, url)
66
+ dst = VENDOR_DIR / rel
67
+ dst.parent.mkdir(parents=True, exist_ok=True)
68
+ # Copy into the repo’s vendor directory so setuptools can package it
69
+ if not dst.exists():
70
+ shutil.copy2(src, dst)
71
+
72
+ class build_py(_build_py):
73
+ def run(self):
74
+ _vendorize()
75
+ super().run()
76
+
77
+ setup(cmdclass={"build_py": build_py})