Skip to main content

Frequenz Market Metering Client

Build Status PyPI Package Docs

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

frequenz_client_marketmetering-0.1.2.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file frequenz_client_marketmetering-0.1.2.tar.gz.

File metadata

File hashes

Hashes for frequenz_client_marketmetering-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b1a84b56f38c5233e4fdf0dd71011d5b0a9a1b2a1d9a0e03725816a4c7dc2387
MD5 042d8178b025ba5b63eac6bd64a40075
BLAKE2b-256 6b64f19aec7ff5e657098d8acbbcd50407b47b1d4decbc6f0811a592c063c578

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frequenz_client_marketmetering-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for frequenz_client_marketmetering-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64abe3e2c254aca3788270a1f4e56777092227ba279c1aab1e29d767e24a298f
MD5 4d135ac8e9e8bed3d40a507672621f05
BLAKE2b-256 6615fad777e882d3d795f6ac4a2e7e30363df850c9ed6d944a645218aeb5862f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page