Giter VIP home page Giter VIP logo

frequenz-client-microgrid-python's Introduction

Frequenz Microgrid API Client

Build Status PyPI Package Docs

Introduction

This project provides a Python client for the Frequenz Microgrid API that is more idiomatic to use in Python than the automatically-generated gRPC client provided by protoc.

Supported Platforms

The following platforms are officially supported (tested):

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

Contributing

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

frequenz-client-microgrid-python's People

Contributors

llucax avatar dependabot[bot] avatar shsms avatar leandro-lucarella-frequenz avatar marenz avatar

Watchers

 avatar  avatar Thea Leake avatar  avatar

Forkers

llucax shsms

frequenz-client-microgrid-python's Issues

Ensure `grpclib` is not leaked

What's needed?

We need to make sure we don't leak the internal dependencies to the users, ensuring that we can change the underlying implementation in the future without it being a breaking change.

Proposed solution

  • Wrap grpclib errors in some ClientError that will have the underlying grpc error as the cause
  • Use a connection string instead of a grpclib.client.Channel

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Use unique channel names

What's needed?

When the client create new channels, it uses a fixed string f"raw-component-data-{component_id}", which means multiple instances of the client will use the same name for channels, which could be confusing/misleading when looking at the logs.

Proposed solution

Add some name to the API client itself so it can be used in the logs too, defaulting to some short hash that will be unlikely match the auto-generated hash of other API client instances.

Wrap missing state and errors

Add a microgrid (API client) mocking tool for users to easily test actors and apps

What's needed?

We need to be able to test examples in the examples directory as part of the CI so we don't break them accidentally (or forget to update them when there are API changes), and allow users to do the same for their apps and actors.

Proposed solution

Create a microgrid mock, or a microgrid API client mock.

The simplest first version should just run an example for few seconds and check if there it didn't crash.

Use cases

No response

Alternatives and workarounds

Test using a real microgrid API, but that would be overkill.

Additional context

No response

Add a specific client errors

What's needed?

Client errors should be easy to catch in a pythonic way, so we should provide one separate error per gRPC status code, at least.

Proposed solution

Add ClientTimeout, RequestCancelled, etc. exceptions inheriting from ClientError.

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.