Visual inspector for energydb: Postgres structure + ClickHouse values, mirrored live next to a marimo demo notebook.
Project description
energydb-inspect
A visual inspector for energydb: a marimo notebook drives energydb and a read-only dashboard mirrors the live state. The asset tree (Postgres) on the left, the timeseries (ClickHouse) as plots, a map of the assets, and the raw backing rows plus the SQL "under the hood".
Quick start
You need a Postgres + ClickHouse for energydb to talk to. The easiest is energydb's local-db
(in the energydb repo, under local-db/):
docker compose up -d # in energydb/local-db: Postgres :5433 + ClickHouse :8123
Point the inspector at it with a .env in your working directory, then run it:
# .env
TIMEDB_PG_DSN=postgresql://postgres:devpassword@localhost:5433/devdb
TIMEDB_CH_URL=http://default:devpassword@localhost:8123/default
INSPECT_WRITABLE=1 # throwaway DB: enables the Reset button
uvx energydb-inspect # or: pip install energydb-inspect && energydb-inspect
Open the dashboard at http://localhost:8000 and the notebook at http://localhost:2718 side by side, then run the notebook cells top-to-bottom and watch the tree fill in live.
Inspect your own energydb (read-only)
Point it at any energydb. Without INSPECT_WRITABLE it is strictly read-only (no Reset, no writes), so
it is safe against production:
TIMEDB_PG_DSN=postgresql://USER:PASS@HOST:5432/DB \
TIMEDB_CH_URL=http://USER:PASS@HOST:8123/DB \
uvx energydb-inspect --no-notebook
Run from source
git clone https://github.com/rebase-energy/energydb-inspect && cd energydb-inspect
uv sync # Python deps (uv fetches its own Python)
./run.fish # backend :8000 + marimo :2718 + Vite dashboard :5173
run.fish reads .env and starts all three. Individually:
env INSPECT_WRITABLE=1 uv run uvicorn energydb_inspect.app:app --reload --port 8000
uv run marimo edit energydb_inspect/notebooks/demo.py --port 2718
cd web && npm install && npm run dev # or bun
NixOS: uv works as-is; bun/node usually aren't on PATH, so front the frontend with nix
(run.fish does this automatically): cd web; nix shell nixpkgs#bun -c bash -c 'bun install && bun run dev'.
Static web demo (in-browser, no server)
A zero-backend build (in-memory mock + a guided Playground) for hosting a "what is energydb" demo:
cd web && npm ci && VITE_TARGET=wasm VITE_BASE="/your-base/" npm run build # -> web/dist
Layout
energydb_inspect/is the Python package:app.py(read-only FastAPI),db.py,queries.py,demo_data.py,cli.py(theenergydb-inspectentrypoint),notebooks/demo.py, and the bundled dashboard (_static/, built fromweb/at publish time).web/is the React + Vite dashboard (D3 tree, ECharts plots, Leaflet map).
Clicking a node or grid edge shows its Postgres metadata and a map of the assets; clicking a series
shows its values. Geometry is stored by energydb in node.data / edge.data as GeoJSON, so the
dashboard reads it straight from the API.
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 energydb_inspect-0.7.0.tar.gz.
File metadata
- Download URL: energydb_inspect-0.7.0.tar.gz
- Upload date:
- Size: 29.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c83cb745849f5ef3ab37a5770178407dd80259ec115235e5a80a92913bb92322
|
|
| MD5 |
e792b16a342e852a10d360414451991d
|
|
| BLAKE2b-256 |
97ac5efdcf314f870f7c53c0cb66f1f4e21045986d80c09fd92f390dc98f68a4
|
Provenance
The following attestation bundles were made for energydb_inspect-0.7.0.tar.gz:
Publisher:
publish.yml on rebase-energy/energydb-inspect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
energydb_inspect-0.7.0.tar.gz -
Subject digest:
c83cb745849f5ef3ab37a5770178407dd80259ec115235e5a80a92913bb92322 - Sigstore transparency entry: 1925428547
- Sigstore integration time:
-
Permalink:
rebase-energy/energydb-inspect@011ba19d9dd97301932275cfaf9a423d22f7ccc5 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/rebase-energy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@011ba19d9dd97301932275cfaf9a423d22f7ccc5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file energydb_inspect-0.7.0-py3-none-any.whl.
File metadata
- Download URL: energydb_inspect-0.7.0-py3-none-any.whl
- Upload date:
- Size: 508.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ea90aefa87c52718bd6dd2fb8baddf299f1c99f6d2152f7af239bc676c6703d
|
|
| MD5 |
56aea919334fa8b41e194a50b45c0f50
|
|
| BLAKE2b-256 |
18c9a2bc21be87c7c3ff593a3c2a21d76ac70fc12ce93a4b44153006477c7998
|
Provenance
The following attestation bundles were made for energydb_inspect-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on rebase-energy/energydb-inspect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
energydb_inspect-0.7.0-py3-none-any.whl -
Subject digest:
9ea90aefa87c52718bd6dd2fb8baddf299f1c99f6d2152f7af239bc676c6703d - Sigstore transparency entry: 1925428660
- Sigstore integration time:
-
Permalink:
rebase-energy/energydb-inspect@011ba19d9dd97301932275cfaf9a423d22f7ccc5 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/rebase-energy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@011ba19d9dd97301932275cfaf9a423d22f7ccc5 -
Trigger Event:
release
-
Statement type: