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.

Metadata

Release files for frequenz-client-marketmetering 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for frequenz-client-marketmetering 0.1.2
File Size Uploaded Provenance Actions
frequenz_client_marketmetering-0.1.2.tar.gz 27.1 kB With provenance Details for frequenz_client_marketmetering-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for frequenz-client-marketmetering 0.1.2
File Interpreter ABI Platform Actions
frequenz_client_marketmetering-0.1.2-py3-none-any.whl Python 3 none any Details for frequenz_client_marketmetering-0.1.2-py3-none-any.whl

Total release size: 52.0 kB

Release files / frequenz_client_marketmetering-0.1.2.tar.gz

Download URL frequenz_client_marketmetering-0.1.2.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b1a84b56f38c5233e4fdf0dd71011d5b0a9a1b2a1d9a0e03725816a4c7dc2387
BLAKE2b-256 checksum
How to use checksums
6b64f19aec7ff5e657098d8acbbcd50407b47b1d4decbc6f0811a592c063c578
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 5, 2026.

Transparency log

Release files / frequenz_client_marketmetering-0.1.2-py3-none-any.whl

Download URL frequenz_client_marketmetering-0.1.2-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64abe3e2c254aca3788270a1f4e56777092227ba279c1aab1e29d767e24a298f
BLAKE2b-256 checksum
How to use checksums
6615fad777e882d3d795f6ac4a2e7e30363df850c9ed6d944a645218aeb5862f
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 5, 2026.

Transparency log

Security for frequenz-client-marketmetering 0.1.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for frequenz_client_marketmetering-0.1.2.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 5, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

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