You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,8 @@ check out the [Contributing Guide](CONTRIBUTING.md).
28
28
29
29
## Usage
30
30
31
-
Please also refer to [examples](https://github.com/frequenz-floss/frequenz-client-reporting-python/tree/HEAD/examples) for more detailed usage.
31
+
Please also refer to source of the [CLI tool](https://github.com/frequenz-floss/frequenz-client-reporting-python/blob/v0.x.x/src/frequenz/client/reporting/cli/__main__.py)
To use the Reporting API client, you need to initialize it with the server URL and authentication credentials.
45
46
The server URL should point to your Frequenz Reporting API instance, and you will need an authentication key and a signing secret.
47
+
See [this documentation](https://github.com/frequenz-floss/frequenz-client-base-python/blob/v0.x.x/README.md#authorization-and-signing) for further details.
46
48
47
49
> **Security Note**
48
50
> Always keep your authentication key and signing secret secure. Do not hard-code them in your source code or share them publicly.
### Query metrics for a single microgrid and component
67
69
68
70
This method supports:
69
-
- Selecting specific `microgrid_id` and `component_id`
70
-
- Choosing one or more `metrics` to retrieve
71
-
- Defining a time range with `start_time` and `end_time`
72
-
- Optional downsampling using `resampling_period` (e.g., `timedelta(minutes=15)`)
71
+
- Selecting specific `microgrid_id` and `component_id`.
72
+
- Choosing one or more `metrics` to retrieve. Available metrics are listed [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.8.0/proto/frequenz/api/common/v1alpha8/metrics/metrics.proto).
73
+
- Defining a time range with `start_time` and `end_time`.
74
+
- Optional downsampling using `resampling_period` (e.g., `timedelta(minutes=15)`).
73
75
74
76
```python
75
77
# Asynchronously collect metric data samples into a list
@@ -168,7 +170,29 @@ data = [
168
170
]
169
171
```
170
172
171
-
### Optionally convert the data to a pandas DataFrame
173
+
## Usage of formulas
174
+
175
+
Formulas can be used to calculate a metric aggregated over multiple components or sensors.
176
+
Note that this endpoint must be used with a `resampling_period`.
177
+
Details on the formula syntax can be found [here](https://github.com/frequenz-floss/frequenz-microgrid-formula-engine-rs/tree/v0.x.x?tab=readme-ov-file#formula-syntax-overview).
178
+
179
+
```python
180
+
# Example formula to sum the values of two components.
0 commit comments