Frequenz CS Reporting Library
Overview
Streamlit library that ships a ready-to-use client reporting UI. It fetches data from the Frequenz reporting API, applies the energy
reporting utilities from frequenz-lib-notebooks, and renders dashboards, tables, and plots with reusable Streamlit components.
Features
- Pre-built Streamlit app with navigation, landing page, and reporting view.
- Connects to the Frequenz reporting API to fetch microgrid measurements.
- Ready-made dashboards (metrics, plots, and tables) powered by
frequenz-lib-notebooks. - Reusable components (sidebar filters, charts, tables) for your own pages.
Quick start
- Install the library (Python 3.12):
pip install "frequenz-cs-reporting"
- Provide environment variables (see below). A
.envfile works with Streamlit:REPORTING_API_URL=https://your-reporting-endpoint FREQUENZ_API_KEY=your-api-key FREQUENZ_API_SECRET=your-signing-secret MICROGRID_CONFIG_DIR=toml_directory/
- Add .toml files to the toml_directory.
- Run the bundled UI from the repo root:
streamlit run app.py
Use the sidebar to pick a microgrid, date range, timezone, and resolution.
Configuration
Environment
REPORTING_API_URL(required): Base URL for the Frequenz reporting API.FREQUENZ_API_KEYandFREQUENZ_API_SECRET(required): Credentials used to authenticate and sign Reporting and Assets API requests.MICROGRID_CONFIG_DIR(optional): Directory containing TOML microgrid configs. Defaults totoml_directory/.
Microgrid configs
Microgrid definitions are loaded from TOML files in MICROGRID_CONFIG_DIR.
Running the Streamlit app
The app entry point is app.py. When you run streamlit run app.py, it:
- Discovers pages from
frequenz.cs_reporting.app_pages(the default build shipsHomeandReportingpages). - Loads microgrid configs from
MICROGRID_CONFIG_DIRand lists available IDs. - Fetches data via the reporting API.
Running in Deepnote
- Running in Deepnote is supported; required environment variables can be injected via the Deepnote integration.
- Add this library as a requirement in requirements.txt
- Add the docker image from dockerhub (currently named: CS-Reporting in deepnote).
- Copy the app.py to the folder structure in Deepnote.
- Click on create_streamlit_application in Deepnote UI to create the app.
Library usage
Fetch microgrid data programmatically (sync wrapper shown):
from datetime import datetime, timedelta
from frequenz.cs_reporting.services.data_service import get_microgrid_data
df = get_microgrid_data(
microgrid_id=241,
start_date=datetime(2024, 1, 1),
end_date=datetime(2024, 1, 2),
resolution=timedelta(minutes=15),
)
Build your own Streamlit page and add it to the navigation by defining a
PageSpec in frequenz.cs_reporting.app_pages:
# app_pages/custom.py
from frequenz.cs_reporting.rep_cs_core.page_spec import PageSpec
import streamlit as st
def render() -> None:
st.title("Custom view")
st.write("Add your own charts or tables here.")
PAGE = PageSpec(key="custom", title="Custom", icon="🛠️", order=10, render=render)
Development
- Install dev tools:
pip install -e ".[dev]". - Run tests:
nox -lto see sessions, e.g.nox -s tests. - Build docs with MkDocs (
README.mdis the landing page). After installing the mkdocs extra you can use thedocsnox session (if available) or runmkdocs serve.
Supported Platforms
The following platforms are officially supported (tested):
- Python: 3.12
- Operating System: Ubuntu Linux 20.04
- Architectures: amd64, arm64
Contributing
If you want to know how to build this project and contribute to it, please check out the Contributing Guide.
Metadata
Release files for frequenz-cs-reporting 0.4.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| frequenz_cs_reporting-0.4.14.tar.gz | 3.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frequenz_cs_reporting-0.4.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 MB
Release files / frequenz_cs_reporting-0.4.14.tar.gz
| Download URL | frequenz_cs_reporting-0.4.14.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abfc3cf93098792fcb68c3968ff4be9ae450833be15066de28d4a345c3770b86
|
|
BLAKE2b-256 checksum How to use checksums |
360f707ea247d42c8f1105cf1f5f3385705d9001842c4aea1a41a88a8e38ede5
|
| 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 Sep 29, 2026.
Transparency logRelease files / frequenz_cs_reporting-0.4.14-py3-none-any.whl
| Download URL | frequenz_cs_reporting-0.4.14-py3-none-any.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7217eb489afa6dff2d8702ac20c56a9581f52cdd5db6cdb949243a9cbc8b9f7c
|
|
BLAKE2b-256 checksum How to use checksums |
71198aab2e75b7832a4332c821d1a3072fd37223c77477194f745ab3bc2fdbe5
|
| 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 Sep 29, 2026.
Transparency log