Skip to main content

Frequenz Gridpool Library

Build Status PyPI Package Docs

Introduction

High-level interface to grid pools for the Frequenz platform.

TODO(cookiecutter): Improve the README file

Supported Platforms

The following platforms are officially supported (tested):

  • Python: 3.11
  • Operating System: Ubuntu Linux 20.04
  • Architectures: amd64, arm64

CLI

This package ships the gridpool-cli command with three subcommands.

Setup

Set the Assets API credentials before running the CLI:

export ASSETS_API_URL="grpc://..."
export ASSETS_API_AUTH_KEY="..."
export ASSETS_API_SIGN_SECRET="..."

Print component formulas

gridpool-cli print-formulas <microgrid_id>

Optional prefix formatting:

gridpool-cli print-formulas <microgrid_id> --prefix "{microgrid_id}.{component}"

The per-category formulas (pv, battery, chp, ev) read the component first and use the meter as the fallback. Use --prefer-meters-in-component-formulas for the opposite order, which is what versions before component graph v0.5.0 produced:

gridpool-cli print-formulas <microgrid_id> --prefer-meters-in-component-formulas

Render component graph

Rendering requires optional dependencies. Install with:

pip install frequenz-gridpool[render-graph]
gridpool-cli render-graph <microgrid_id>

To save without opening a window:

gridpool-cli render-graph <microgrid_id> --no-show --output component_graph.png

Generate microgrid config

Derive metadata, formulas and component IDs for one or more microgrids from the Assets API and print them as dotted-key TOML to stdout:

gridpool-cli generate-config <microgrid_id> [<microgrid_id> ...]

Redirect stdout to save the result:

gridpool-cli generate-config <microgrid_id> > microgrid.toml

You can layer existing config files with the Assets API by precedence (--default < Assets API < --override). Values from a --default file are overridden by the API, while a --override file keeps its own values and the API only fills the gaps:

gridpool-cli generate-config <microgrid_id> \
    --default defaults.toml \
    --override overrides.toml > microgrid.toml

If no microgrid IDs are given, they are taken from the supplied files:

gridpool-cli generate-config --override existing.toml > microgrid.toml

--prefer-meters-in-component-formulas works here too, so a regenerated config can keep the meter-first order of the per-category formulas:

gridpool-cli generate-config <microgrid_id> \
    --prefer-meters-in-component-formulas > microgrid.toml

Contributing

If you want to know how to build this project and contribute to it, please check out the Contributing Guide.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frequenz_gridpool-0.6.2.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

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

frequenz_gridpool-0.6.2-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file frequenz_gridpool-0.6.2.tar.gz.

File metadata

  • Download URL: frequenz_gridpool-0.6.2.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for frequenz_gridpool-0.6.2.tar.gz
Algorithm Hash digest
SHA256 ee7e83d8d58a3c86ad09da08c3db26178faa1ece727e605224f3e3593ef27eec
MD5 dbbe44ca7423ad4765e8956106a36f6d
BLAKE2b-256 93240864d87e752f89497ace94f7e39ae0a5e329ac33f186d7cafb5c10ce3cbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for frequenz_gridpool-0.6.2.tar.gz:

Publisher: ci.yaml on frequenz-floss/frequenz-gridpool-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_gridpool-0.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for frequenz_gridpool-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24be93c1612b59703c75303457e59a625d9ce4a0179c759021f555b54eeb89ea
MD5 a37eeb3da05d697b2bedce90fe95b2ed
BLAKE2b-256 5381ada443e032754c11ed428d6e50d9a7c6c2480dd45a28fd52168703c86737

See more details on using hashes here.

Provenance

The following attestation bundles were made for frequenz_gridpool-0.6.2-py3-none-any.whl:

Publisher: ci.yaml on frequenz-floss/frequenz-gridpool-python

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page