Systems Advisor for Microgrids & Building Analysis
Project description
SAMBA
Systems Advisor for Microgrids & Building Analysis — optimal sizing and techno-economic analysis of hybrid energy systems.
Describe a system in a YAML file; SAMBA formulates and solves a linear program (oemof-solph + HiGHS) for the least-cost component sizing and hourly dispatch, then writes a structured directory of result artifacts.
Features
- Provably-optimal sizing (LP/MILP) — PV, wind, battery, diesel, inverter, grid, EV/V2G
- Thermal domain — heat pump, thermal storage, and gas boiler with merit-order dispatch
- 8 tariff structures — flat, TOU, tiered, seasonal, monthly (and combinations), plus demand charges and NEM/net-billing
- Multi-objective cost + CO₂ with epsilon-constraint Pareto fronts
- Real-world data — NSRDB weather fetch, bifacial PV, battery degradation, load-profile templates
- Four ways to use it — Python API, CLI, REST service, and a Vue 3 + Tauri desktop/web UI
- Standardised artifacts —
kpis.json,dispatch.parquet,economics.json,sizing.csv
Quick start
pip install samba-core[cli]
samba run examples/base_scenario.yaml -o results/
import samba
from samba.scenario import load_scenario
from samba.input_resolver import resolve_arrays
from pathlib import Path
scenario = load_scenario("examples/base_scenario.yaml")
load_kw, pv_per_kwp, wind_power_kw = resolve_arrays(scenario, Path("examples"))
result = samba.run(scenario, load_kw=load_kw, pv_per_kwp=pv_per_kwp, output_dir="results/")
print(f"NPC ${result.kpis['npc']:,.0f} · LCOE ${result.kpis['lcoe']:.3f}/kWh")
The default solver is HiGHS (installed via highspy); CBC also works
(--solver cbc).
Desktop & Web UI
A Vue 3 + Tauri front-end talks to the samba serve REST API and runs in
the browser or as a native desktop app:
samba serve --data-dir examples # REST API on http://127.0.0.1:8000
cd ui && npm install && npm run dev # UI on http://localhost:1420
Documentation
| Document | Description |
|---|---|
| Getting Started | Install and run your first scenario |
| Scenario Reference | Complete YAML schema reference |
| Thermal Components | Heat pump, thermal storage, gas supply |
| CLI Reference | run, validate, info, serve, … |
| API Reference | Python API |
| Deployment | REST service (Docker, persistence, CI) |
| Desktop / Web UI | Running and developing the front-end |
| Known Limitations | What SAMBA does and does not model |
Contributing
See CONTRIBUTING.md. Development uses uv:
git clone https://github.com/sambaenergies/samba.git
cd samba && uv sync --all-extras
License
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 samba_core-5.3.1.tar.gz.
File metadata
- Download URL: samba_core-5.3.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b723172cd7e9ed3c8feaffc32407abec475a5c237e491fbcf81bb3a25fbafb07
|
|
| MD5 |
74341a12bef0ab051a06c4e10f8af2bd
|
|
| BLAKE2b-256 |
bc0ed1b8f797dabc238e7711762fd8de9f11aea910b3d62c660435c43af51d0f
|
Provenance
The following attestation bundles were made for samba_core-5.3.1.tar.gz:
Publisher:
release.yml on sambaenergies/samba
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
samba_core-5.3.1.tar.gz -
Subject digest:
b723172cd7e9ed3c8feaffc32407abec475a5c237e491fbcf81bb3a25fbafb07 - Sigstore transparency entry: 1990884181
- Sigstore integration time:
-
Permalink:
sambaenergies/samba@508676c020cfe904ceced43374a330fdf82d39ab -
Branch / Tag:
refs/tags/v5.3.1 - Owner: https://github.com/sambaenergies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@508676c020cfe904ceced43374a330fdf82d39ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file samba_core-5.3.1-py3-none-any.whl.
File metadata
- Download URL: samba_core-5.3.1-py3-none-any.whl
- Upload date:
- Size: 216.6 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 |
bf0135b5a46774c06fe02ad261aee0cff7f647d0bbee93f9764c9ab3049b764e
|
|
| MD5 |
f63bb8536eea9db6c990b5ff888c7fb4
|
|
| BLAKE2b-256 |
3dea304a34a9bd47d4448c5f64bfeab389ed38c470b7462f04fd1b9ce4bbf8a2
|
Provenance
The following attestation bundles were made for samba_core-5.3.1-py3-none-any.whl:
Publisher:
release.yml on sambaenergies/samba
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
samba_core-5.3.1-py3-none-any.whl -
Subject digest:
bf0135b5a46774c06fe02ad261aee0cff7f647d0bbee93f9764c9ab3049b764e - Sigstore transparency entry: 1990884418
- Sigstore integration time:
-
Permalink:
sambaenergies/samba@508676c020cfe904ceced43374a330fdf82d39ab -
Branch / Tag:
refs/tags/v5.3.1 - Owner: https://github.com/sambaenergies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@508676c020cfe904ceced43374a330fdf82d39ab -
Trigger Event:
push
-
Statement type: