Tools
Energy Toolkit provides two tools for energy forecasting. Both follow the same design philosophy (a Python generator, a data API, and an interactive web frontend) but address different questions about the energy system.
Shared design philosophy
Both tools are built around the same three-layer architecture. This is a deliberate design choice that makes each tool independently forkable, deployable, and customizable while sharing a common mental model.
Generator
A Python engine that takes input data and configuration, runs a model, and produces structured output. The generator is the only part that needs domain expertise.
- Demand: Historical data + transformations → Parquet
- Generation: Weather + demand + PyPSA → capacity plans
API
A data layer that serves generator output through standardized endpoints. Static JSON for metadata, dynamic queries for time series and scenario data.
- Demand: OpenAPI 3.1 + DuckDB on Parquet
- Generation: File-based API (local or HTTP server)
Frontend
An interactive web application for exploring the data. Charts, maps, scenario comparison, designed for multiple audiences from the public to domain experts.
- Demand: SvelteKit + LayerChart + Mapbox GL
- Generation: Streamlit + Plotly + Folium
Designed to be forked
The tools are not SaaS products. They are starting points. Fork a repo, swap in your own data and models, and deploy. The architecture is designed to make this straightforward.
Flexible inputs
- Any region: Provide your own GeoJSON boundaries and demand data. The Demand tool ships with Swedish data; adapt it for your country or region.
- Any scenario model: The generators are modular. Replace the transformation functions with your own forecasting models while keeping the data pipeline intact.
- Configuration-driven: Scenarios, geographies, segments, and parameters are defined in config files (YAML or JSON). Change the config, regenerate, and the entire stack updates.
Flexible deployment
- Run locally: Both tools work on a laptop with no cloud services. Good for development and internal use.
- Deploy to the cloud: Both tools run on any standard cloud platform. Bring your own infrastructure; the tools have no vendor lock-in.
- Static or dynamic: Frontends generate fully static sites that can be served by any static host or CDN. APIs can run as containers or serve pre-built files.
Maturity
The two tools are at different stages of development. Both are functional and deployed, but the Demand tool has a more mature framework architecture.
Demand
- ✓ Full-stack framework with clear separation
- ✓ Comprehensive test coverage (60+ tests)
- ✓ CI/CD pipeline with GitHub Actions
- ✓ Documentation, coding standards, debugging guides
- ✓ Multi-language support (Paraglide i18n)
Generation
- ✓ Working generator with PyPSA optimization
- ✓ Streamlit dashboard with scenario controls
- ✓ Flexible API (local filesystem or HTTP server)
- ✓ Docker deployment support
- ○ Planned: SvelteKit frontend migration
- ○ Planned: Enhanced documentation