Energy Customer Data Model
Reusable star-schema template for energy retailers/DSOs connecting customers, contracts, metering points, and products — the foundation layer for CLV, settlement, and trading.
Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
⚙ Try Demo ToolsFile Structure 19 files
Documentation Preview README excerpt
Energy Customer Data Model
A reusable star-schema template for energy retailers and DSOs that connects
customers, contracts, metering points, and products — the foundation gold layer
that CLV, balance settlement, and trading analytics plug into.
Fully generic and environment-agnostic: adapt the source references to your
CIS/billing system, pick a business domain (electricity_sales / heat_and_cooling
/ distribution), and deploy.
What's inside
- Databricks Asset Bundle — a daily refresh (4 dimensions → central fact →
quality summary).
- Four conformed dimensions — customer, contract, metering point, product,
each with a deterministic surrogate key.
- A central fact at (contract × metering point) grain with referential
integrity to every dimension.
- A quality summary — grain-uniqueness and orphan-key checks.
- A dependency-free modeling library (
lib/star_schema.py): surrogate keys,
grain-violation detection, referential-orphan detection, completeness, and
conformed-dimension checks — with an offline test suite (5 tests).
Quickstart
pip install pytest && pytest tests/ -v
databricks bundle deploy -t dev -p <profile>
Map your CIS source tables (cis.customers, cis.contracts,
cis.metering_points, cis.products, and the bridge tables).
License
MIT — see LICENSE.