Skip to content

frequenz-floss/frequenz-gridpool-python

Repository files navigation

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}"

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

Contributing

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

About

High-level interface to grid pools for the Frequenz platform

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages