Skip to main content

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,
    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 versioned JSON snapshot to the vault
write_local_json_snapshot("40 - Recursos/data/snapshot.json", data)

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 outbound requests calls require_local_runtime() and raises RuntimeError when running inside a packaged HTML/WASM notebook. This boundary is intentional: ETL logic runs locally before export; the published notebook only reads pre-generated snapshots.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dgk_lab_runtime-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dgk_lab_runtime-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file dgk_lab_runtime-0.1.0.tar.gz.

File metadata

  • Download URL: dgk_lab_runtime-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dgk_lab_runtime-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca1b1ece8c0a0c4af54e9a47e9c149d8160431cf5fa43e589697d32dfbf0b2a1
MD5 c10632b66595a5300c53c4ceef38ef46
BLAKE2b-256 48af03ebc773a30bdf9c601b3f0f00c1b4a1f974b5cc2e7a309f64ececda3728

See more details on using hashes here.

Provenance

The following attestation bundles were made for dgk_lab_runtime-0.1.0.tar.gz:

Publisher: publish-lab-runtime.yml on aretw0/vault-seed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dgk_lab_runtime-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dgk_lab_runtime-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 766872c9b74b05b546b44cfb9e8bd7bee403b2da5add0873f8d885e4c52a8914
MD5 2c13656817ecde2bfbd6ebc14aeb83ec
BLAKE2b-256 dbf376fd48d6ef61f0fb36959f906e55c84865ab956a37b42f8313234f742446

See more details on using hashes here.

Provenance

The following attestation bundles were made for dgk_lab_runtime-0.1.0-py3-none-any.whl:

Publisher: publish-lab-runtime.yml on aretw0/vault-seed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page