Frequenz Market Metering Client
Introduction
A Python client for the Frequenz Market Metering API, providing access to historical and real-time metering samples from Market Locations across various energy markets (Germany, UK, US, Australia, etc.).
Features
- Stream metering samples from Market Locations
- Support for multiple market identifier types (MaLo-ID, MPAN, ESI-ID, NMI)
- Filtering by energy flow direction (import/export)
- Multiple metric types (active energy, active power, reactive energy/power)
- Optional resampling for time-series aggregation
- CLI tool for quick access to metering data
Installation
pip install frequenz-client-marketmetering
For CLI support:
pip install "frequenz-client-marketmetering[cli]"
Quick Start
Python API
from datetime import datetime, timezone
from frequenz.client.marketmetering import MarketMeteringApiClient
from frequenz.client.marketmetering.types import (
EnergyFlowDirection,
MarketArea,
MarketLocationId,
MarketLocationIdType,
MarketLocationRef,
MetricType,
)
# Create client
client = MarketMeteringApiClient(
server_url="grpc://marketmetering.example.com",
auth_key="your-api-key",
)
# Define a Market Location (e.g., German MaLo)
market_location = MarketLocationRef(
market_area=MarketArea.EU_DE,
market_location_id=MarketLocationId(
value="DE01234567890",
type=MarketLocationIdType.MALO_ID,
),
)
# Stream metering samples
async for series in client.stream_samples(
market_locations=[market_location],
directions=[EnergyFlowDirection.IMPORT],
metric_types=[MetricType.ACTIVE_ENERGY],
start_time=datetime(2025, 1, 1, tzinfo=timezone.utc),
):
for sample in series.samples:
print(f"{sample.sample_time}: {sample.value} {series.metric_unit.name}")
CLI
# Set environment variables
export MARKETMETERING_API_URL="grpc://marketmetering.example.com"
export MARKETMETERING_API_AUTH_KEY="your-api-key"
# Stream samples from a German Market Location
marketmetering-cli stream EU_DE:DE01234567890:MALO_ID
# Stream with specific options
marketmetering-cli stream EU_DE:DE01234567890:MALO_ID \
--direction IMPORT \
--metric ACTIVE_ENERGY \
--start-time "2025-01-01T00:00:00" \
--resolution MIN_15
Market Location Types
The client supports various market identifier types:
| Type | Market | Example |
|---|---|---|
MALO_ID |
Germany | DE01234567890 |
MPAN |
United Kingdom | 18106612345678901234 |
ESI_ID |
US (ERCOT) | 10443720000012345 |
NMI |
Australia | NEM1203456A |
Supported Platforms
- Python: 3.11+
- Operating System: Ubuntu Linux 20.04+
- Architectures: amd64, arm64
Documentation
For detailed documentation, please visit: https://frequenz-floss.github.io/frequenz-client-marketmetering-python/
Contributing
If you want to know how to build this project and contribute to it, please check out the Contributing Guide.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 frequenz_client_marketmetering-0.1.2.tar.gz.
File metadata
- Download URL: frequenz_client_marketmetering-0.1.2.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1a84b56f38c5233e4fdf0dd71011d5b0a9a1b2a1d9a0e03725816a4c7dc2387
|
|
| MD5 |
042d8178b025ba5b63eac6bd64a40075
|
|
| BLAKE2b-256 |
6b64f19aec7ff5e657098d8acbbcd50407b47b1d4decbc6f0811a592c063c578
|
Provenance
The following attestation bundles were made for frequenz_client_marketmetering-0.1.2.tar.gz:
Publisher:
ci.yaml on frequenz-floss/frequenz-client-marketmetering-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frequenz_client_marketmetering-0.1.2.tar.gz -
Subject digest:
b1a84b56f38c5233e4fdf0dd71011d5b0a9a1b2a1d9a0e03725816a4c7dc2387 - Sigstore transparency entry: 2343394383
- Sigstore integration time:
-
Permalink:
frequenz-floss/frequenz-client-marketmetering-python@40c53cb1f9d9fa80d6db88b50eeb59104374dfdb -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/frequenz-floss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@40c53cb1f9d9fa80d6db88b50eeb59104374dfdb -
Trigger Event:
push
-
Statement type:
File details
Details for the file frequenz_client_marketmetering-0.1.2-py3-none-any.whl.
File metadata
- Download URL: frequenz_client_marketmetering-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64abe3e2c254aca3788270a1f4e56777092227ba279c1aab1e29d767e24a298f
|
|
| MD5 |
4d135ac8e9e8bed3d40a507672621f05
|
|
| BLAKE2b-256 |
6615fad777e882d3d795f6ac4a2e7e30363df850c9ed6d944a645218aeb5862f
|
Provenance
The following attestation bundles were made for frequenz_client_marketmetering-0.1.2-py3-none-any.whl:
Publisher:
ci.yaml on frequenz-floss/frequenz-client-marketmetering-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frequenz_client_marketmetering-0.1.2-py3-none-any.whl -
Subject digest:
64abe3e2c254aca3788270a1f4e56777092227ba279c1aab1e29d767e24a298f - Sigstore transparency entry: 2343394842
- Sigstore integration time:
-
Permalink:
frequenz-floss/frequenz-client-marketmetering-python@40c53cb1f9d9fa80d6db88b50eeb59104374dfdb -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/frequenz-floss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@40c53cb1f9d9fa80d6db88b50eeb59104374dfdb -
Trigger Event:
push
-
Statement type: