A highlevel interface for the reporting API
Project description
Reporting Highlevel Interface
Introduction
A highlevel interface for the reporting API
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.
Installation
# Choose the version you want to install
VERSION=0.3.0
pip install frequenz-reporting-python==$VERSION
Initialize the client
from datetime import datetime
from frequenz.client.common.metric import Metric
from frequenz.client.reporting import ReportingApiClient
from frequenz.reporting._reporting import cumulative_energy
# Change server address
SERVICE_ADDRESS = "grpc://replace-this-with-your-server-url:port"
API_KEY = open('api_key.txt').read().strip()
client = ReportingApiClient(service_address=SERVICE_ADDRESS, key=API_KEY)
Calculate cumulative energy for a single microgrid and component:
If the component does not measure Metric.AC_ACTIVE_ENERGY, set use_active_power=True
to utilize Metric.AC_ACTIVE_POWER instead.
A resampling period can be set that alters how NaNs are handled, resulting in varying results. NaN values are ignored in sums, which may lead to significant data loss if many are present in the raw data. There is no universally correct method for handling NaNs, as their causes can vary.
energy_reading = await cumulative_energy(
client=client,
microgrid_id=1,
component_id=100,
start_time=datetime.fromisoformat("2024-09-01T00:00:00"),
end_time=datetime.fromisoformat("2024-09-30T00:00:00"),
use_active_power=True,
resampling_period=timedelta(seconds=10),
)
print(energy_reading)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frequenz_reporting_python-0.5.0.tar.gz.
File metadata
- Download URL: frequenz_reporting_python-0.5.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a43883a97eded623ab88feaca0945486e0f55ffc132d5a4e66b176c1bbf5ec
|
|
| MD5 |
2bf3b288fef86f2fa6d8b46a68b47ced
|
|
| BLAKE2b-256 |
dcab583e53e11ea63838396d07f7d42d201449c260cf208d9297d3fb9cd08558
|
Provenance
The following attestation bundles were made for frequenz_reporting_python-0.5.0.tar.gz:
Publisher:
ci.yaml on frequenz-floss/frequenz-reporting-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frequenz_reporting_python-0.5.0.tar.gz -
Subject digest:
16a43883a97eded623ab88feaca0945486e0f55ffc132d5a4e66b176c1bbf5ec - Sigstore transparency entry: 305823174
- Sigstore integration time:
-
Permalink:
frequenz-floss/frequenz-reporting-python@4ab7289ebd25e92739b894708b0fa8c75207f34b -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/frequenz-floss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@4ab7289ebd25e92739b894708b0fa8c75207f34b -
Trigger Event:
push
-
Statement type:
File details
Details for the file frequenz_reporting_python-0.5.0-py3-none-any.whl.
File metadata
- Download URL: frequenz_reporting_python-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dc721242210b4ef2143eba8ccc9d06bb349ef4da6d0706a0ef53510ee59cb82
|
|
| MD5 |
8e333ac3d87d6402e7010c907c0f1fb6
|
|
| BLAKE2b-256 |
24b4f6525bd5ea1f1c006a05a8476c859ac8755f0d92bdb89707ba3fcd52d65a
|
Provenance
The following attestation bundles were made for frequenz_reporting_python-0.5.0-py3-none-any.whl:
Publisher:
ci.yaml on frequenz-floss/frequenz-reporting-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frequenz_reporting_python-0.5.0-py3-none-any.whl -
Subject digest:
8dc721242210b4ef2143eba8ccc9d06bb349ef4da6d0706a0ef53510ee59cb82 - Sigstore transparency entry: 305823181
- Sigstore integration time:
-
Permalink:
frequenz-floss/frequenz-reporting-python@4ab7289ebd25e92739b894708b0fa8c75207f34b -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/frequenz-floss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@4ab7289ebd25e92739b894708b0fa8c75207f34b -
Trigger Event:
push
-
Statement type: