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
Metadata
Release files for samba-core 6.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| samba_core-6.0.0.tar.gz | 1.5 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| samba_core-6.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.7 MB
Release files / samba_core-6.0.0.tar.gz
| Download URL | samba_core-6.0.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9076446b3b9f12afadd0f77dbe0504535ba4c62f5c2dc4c2ef696599cc89538f
|
|
BLAKE2b-256 checksum How to use checksums |
8f281f1091b6dbf7d3b3a8f116864bf97d193021cf501f34777110e2a7f0ce37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / samba_core-6.0.0-py3-none-any.whl
| Download URL | samba_core-6.0.0-py3-none-any.whl |
|---|---|
| Size | 220.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc38f2e4206ae8eb7dc5a5850e86b09393b3068371d60cf25ca286c2610739fd
|
|
BLAKE2b-256 checksum How to use checksums |
866ea4bee3040d935abd775642a6e4953323567713b37284800f19de0a842a29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logSecurity for samba-core 6.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for samba_core-6.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.