Download scripts/make_manifest.py from PYTHAI/drAIML: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/spaces/PYTHAI/drAIML/resolve/main/scripts/make_manifest.py
- Command line
-
hf download hf://spaces/PYTHAI/drAIML/scripts/make_manifest.py
-
curl -L -o make_manifest.py https://huggingface.co/spaces/PYTHAI/drAIML/resolve/main/scripts/make_manifest.py
642 Bytes
| """Write app/manifest.json: the files index.html hands to stlite, plus a cache-busting build id.""" | |
| import hashlib, json | |
| from pathlib import Path | |
| APP = Path(__file__).resolve().parents[1] / "app" | |
| files = sorted(str(p.relative_to(APP)) for p in APP.rglob("*") | |
| if p.is_file() and p.suffix in {".py", ".json", ".txt"} and "__pycache__" not in p.parts | |
| and p.name != "manifest.json") | |
| h = hashlib.sha256(b"".join((APP / f).read_bytes() for f in files)).hexdigest()[:12] | |
| (APP / "manifest.json").write_text(json.dumps({"build": h, "requirements": [], "files": files}, indent=1)) | |
| print(f"{len(files)} files, build {h}") | |