← Back to all products

Energy Customer Data Model

$2490

Reusable star-schema template for energy retailers/DSOs connecting customers, contracts, metering points, and products — the foundation layer for CLV, settlement, and trading.

19 filesv1.0.0
PythonMarkdownSQLYAMLJSONDatabricks

Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

⚙ Try Demo Tools

File Structure 19 files

energy-customer-data-model/ ├── LICENSE ├── README.md ├── conftest.py ├── databricks.yml ├── guide/ │ ├── 01_what-you-get.md │ ├── 02_getting-started.md │ ├── 03_architecture.md │ └── 04_support.md ├── guides/ │ └── data-modeling-methodology.md ├── lib/ │ └── star_schema.py ├── resources/ │ └── jobs.yml ├── src/ │ ├── dimensions/ │ │ ├── d_contract.sql │ │ ├── d_customer.sql │ │ ├── d_metering_point.sql │ │ └── d_product.sql │ ├── facts/ │ │ └── f_contract_mp_customer_product.sql │ └── quality/ │ └── quality_monitoring_summary.sql └── tests/ └── test_star_schema.py

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.

Code Sample .py preview

conftest.py import os,sys sys.path.insert(0, os.path.dirname(__file__))