Digital Gardening Kit — Lab notebook runtime utilities for Marimo notebooks in Obsidian vaults
Project description
dgk-lab-runtime
Lab notebook runtime utilities from the Digital Gardening Kit.
Designed for Marimo notebooks that live alongside an Obsidian vault — handles the runtime boundary between local ETL (filesystem, secrets, network) and the published HTML/WASM notebook. Works with any vault layout; the defaults follow the vault-seed conventions (lab/ as the notebooks path, public/lab/ as the dataset directory) which you can override via environment variables or function arguments.
Install
pip install dgk-lab-runtime
# with scraping support (Playwright)
pip install "dgk-lab-runtime[scraping]"
# with OCR support (Tesseract)
pip install "dgk-lab-runtime[ocr]"
Usage
from dgk_lab_runtime import (
lab_runtime_context,
read_lab_json,
load_lab_manifest,
read_lab_dataset,
write_local_json_snapshot,
lab_altair_chart,
lab_altair_status_color,
fetch_wasm_feed,
fetch_wasm_json,
fetch_local_feed,
fingerprint_data,
with_data_provenance,
)
ctx = lab_runtime_context()
# {"runtime": "local", "isPackaged": False, "capabilities": {...}, ...}
# Read a dataset from the Lab manifest (local or Pyodide/WASM)
data = read_lab_dataset("my-dataset")
# Write a local JSON snapshot for the ETL/export boundary
write_local_json_snapshot(".dgk/my-dataset.json", data)
# Keep charts aligned with the Lab shell instead of Vega defaults
chart = lab_altair_chart(chart.encode(color=lab_altair_status_color("status:N")))
Configuration
| Environment variable | Default | Description |
|---|---|---|
VAULT_NOTEBOOKS_PATH |
lab |
URL segment where notebooks are published |
Runtime boundary
Every function that writes files, reads secrets, or makes local outbound requests calls require_local_runtime() and raises RuntimeError when running inside a packaged HTML/WASM notebook. Browser-safe helpers such as fetch_wasm_json() and fetch_wasm_feed() use Pyodide's pyfetch with cache="no-store". This boundary is intentional: ETL logic runs locally before export; the published notebook only reads pre-generated snapshots or public CORS-friendly endpoints.
Vault-seed compatibility
If you use vault-seed, the _lab_notebook_runtime.py shim in 99 - Meta e Anexos/Notebooks/ imports this package transparently when installed, so existing notebooks work unchanged. Without installation the shim uses an inline fallback — same API, no external dependency.
License
GPL-3.0-only — see LICENSE.md in the repository root.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dgk_lab_runtime-0.2.1.tar.gz.
File metadata
- Download URL: dgk_lab_runtime-0.2.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d198dca69c82a39da074b63d58741058458512246ad7794605a82cf4bbef5114
|
|
| MD5 |
4a774bbf4d66814d6bd5acccda19cf70
|
|
| BLAKE2b-256 |
f54e595ed4ea41021c1217360cba38c53288e4cd3c3a4430e4bbbb79e6f08234
|
Provenance
The following attestation bundles were made for dgk_lab_runtime-0.2.1.tar.gz:
Publisher:
publish-lab-runtime.yml on aretw0/vault-seed
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dgk_lab_runtime-0.2.1.tar.gz -
Subject digest:
d198dca69c82a39da074b63d58741058458512246ad7794605a82cf4bbef5114 - Sigstore transparency entry: 1889621637
- Sigstore integration time:
-
Permalink:
aretw0/vault-seed@a8b858cb042c9cd164f6e0a7cc0f69da6d1e2707 -
Branch / Tag:
refs/tags/dgk-lab-runtime@0.2.1 - Owner: https://github.com/aretw0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lab-runtime.yml@a8b858cb042c9cd164f6e0a7cc0f69da6d1e2707 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dgk_lab_runtime-0.2.1-py3-none-any.whl.
File metadata
- Download URL: dgk_lab_runtime-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
714ac24d49c41ed15890b0533f4a72fb1e568c570c6849f5cbe10e004a8c4559
|
|
| MD5 |
238fa5f25701fcbb84b6876d7c6def45
|
|
| BLAKE2b-256 |
90e38531eb3b09c4d10d37d26723ac914ce2a6fe0196b6a390278c5ed8bb9af3
|
Provenance
The following attestation bundles were made for dgk_lab_runtime-0.2.1-py3-none-any.whl:
Publisher:
publish-lab-runtime.yml on aretw0/vault-seed
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dgk_lab_runtime-0.2.1-py3-none-any.whl -
Subject digest:
714ac24d49c41ed15890b0533f4a72fb1e568c570c6849f5cbe10e004a8c4559 - Sigstore transparency entry: 1889621702
- Sigstore integration time:
-
Permalink:
aretw0/vault-seed@a8b858cb042c9cd164f6e0a7cc0f69da6d1e2707 -
Branch / Tag:
refs/tags/dgk-lab-runtime@0.2.1 - Owner: https://github.com/aretw0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lab-runtime.yml@a8b858cb042c9cd164f6e0a7cc0f69da6d1e2707 -
Trigger Event:
push
-
Statement type: