baltic-py 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
baltic/__init__.py ADDED
@@ -0,0 +1,67 @@
1
+ """Pythonic client for the Baltic Transparency Dashboard open API.
2
+
3
+ The API is public and read-only, so the module-level helpers below are bound to
4
+ a shared default client and need no setup::
5
+
6
+ import baltic
7
+
8
+ baltic.reports("imbalance")
9
+ export = baltic.export(
10
+ "imbalance_prices", start="2024-01-01", end="2024-02-01"
11
+ )
12
+ export.rows()
13
+
14
+ Create a :class:`Client` explicitly to change the timeout, retry policy, default
15
+ timezone or the time window used to split long queries.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from . import models
21
+ from ._client import (
22
+ DEFAULT_BASE_URL,
23
+ DEFAULT_MAX_WINDOW,
24
+ MINUTE_MAX_WINDOW,
25
+ Client,
26
+ __version__,
27
+ )
28
+ from ._errors import (
29
+ BalticBadRequest,
30
+ BalticError,
31
+ BalticHTTPError,
32
+ BalticServerError,
33
+ BalticTransportError,
34
+ )
35
+ from ._params import OUTPUT_FORMATS, TIMEZONES
36
+ from ._reports import CATEGORIES, REPORT_IDS, report, reports
37
+
38
+ _default = Client()
39
+
40
+ export = _default.export
41
+ export_many = _default.export_many
42
+ download = _default.download
43
+ download_many = _default.download_many
44
+
45
+ __all__ = [
46
+ "CATEGORIES",
47
+ "DEFAULT_BASE_URL",
48
+ "DEFAULT_MAX_WINDOW",
49
+ "MINUTE_MAX_WINDOW",
50
+ "OUTPUT_FORMATS",
51
+ "REPORT_IDS",
52
+ "TIMEZONES",
53
+ "BalticBadRequest",
54
+ "BalticError",
55
+ "BalticHTTPError",
56
+ "BalticServerError",
57
+ "BalticTransportError",
58
+ "Client",
59
+ "__version__",
60
+ "download",
61
+ "download_many",
62
+ "export",
63
+ "export_many",
64
+ "models",
65
+ "report",
66
+ "reports",
67
+ ]
baltic/_catalog.py ADDED
@@ -0,0 +1,404 @@
1
+ """Catalog of the reports the BTD API can export.
2
+
3
+ Generated by ``src/gen_catalog.py`` from ``spec/``. Do not edit.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ from .models import Report
9
+
10
+ # The API rejects an export-multiple request with more report IDs than this.
11
+ MAX_REPORTS_PER_REQUEST = 4
12
+
13
+ REPORTS: tuple[Report, ...] = (
14
+ Report(
15
+ id="activations_afrr",
16
+ title="Activations - aFRR",
17
+ resolutions=("PT15M",),
18
+ categories=("Balancing", "Activations"),
19
+ ),
20
+ Report(
21
+ id="afrr_bid_prices",
22
+ title="aFRR bid prices",
23
+ resolutions=("PT15M",),
24
+ categories=("Balancing", "Bids", "Offered Prices"),
25
+ ),
26
+ Report(
27
+ id="afrr_satisfied_demand_price",
28
+ title="aFRR satisfied demand price",
29
+ resolutions=("PT15M",),
30
+ categories=("Balancing", "Balancing and Imbalance Prices"),
31
+ ),
32
+ Report(
33
+ id="allocated_capacity_limit",
34
+ title="Allocated capacity limit",
35
+ resolutions=("PT15M",),
36
+ categories=("Reserves",),
37
+ ),
38
+ Report(
39
+ id="allocated_cb_capacity",
40
+ title='Allocated cross-border capacity for balancing reserves ("Description" tab includes link to 60-min)',
41
+ resolutions=("PT15M",),
42
+ categories=("Reserves",),
43
+ ),
44
+ Report(
45
+ id="allocated_cb_capacity_legacy",
46
+ title="Allocated cross-border capacity for balancing reserves (Legacy)",
47
+ resolutions=("PT1H",),
48
+ categories=("Legacy",),
49
+ ),
50
+ Report(
51
+ id="applied_mark_up",
52
+ title="Applied mark-up",
53
+ resolutions=("PT15M",),
54
+ categories=("Reserves",),
55
+ ),
56
+ Report(
57
+ id="balancing_energy_prices",
58
+ title="Balancing energy reference prices",
59
+ resolutions=("PT15M",),
60
+ categories=("Balancing", "Balancing and Imbalance Prices"),
61
+ ),
62
+ Report(
63
+ id="baltic_tso_tso_exchange",
64
+ title="Baltic TSO-TSO exchange",
65
+ resolutions=("PT15M",),
66
+ categories=("Exchange",),
67
+ ),
68
+ Report(
69
+ id="countertrade",
70
+ title="Countertrade",
71
+ resolutions=("PT15M",),
72
+ categories=("Legacy",),
73
+ ),
74
+ Report(
75
+ id="cross_border_capacity_limits_v2",
76
+ title="Cross-border capacity limits",
77
+ resolutions=("PT15M",),
78
+ categories=("Balancing", "Capacities"),
79
+ ),
80
+ Report(
81
+ id="cross_border_marginal_price",
82
+ title="Cross border marginal price",
83
+ resolutions=("PT15M",),
84
+ categories=("Balancing", "Balancing and Imbalance Prices"),
85
+ ),
86
+ Report(
87
+ id="cross_zonal_capacities",
88
+ title="Cross-Zonal Capacities",
89
+ resolutions=("PT15M",),
90
+ categories=("Legacy",),
91
+ ),
92
+ Report(
93
+ id="current_balancing_state",
94
+ title="Current balancing state (legacy)",
95
+ resolutions=("PT1M",),
96
+ categories=("Legacy",),
97
+ ),
98
+ Report(
99
+ id="current_balancing_state_v2",
100
+ title="Current balancing state",
101
+ resolutions=("PT1M",),
102
+ categories=("Balancing",),
103
+ ),
104
+ Report(
105
+ id="da_mfrr_bid_prices",
106
+ title="DA mFRR bid prices",
107
+ resolutions=("PT15M",),
108
+ categories=("Balancing", "Bids", "Offered Prices"),
109
+ ),
110
+ Report(
111
+ id="da_mfrr_bid_volumes",
112
+ title="DA mFRR bid volumes",
113
+ resolutions=("PT15M",),
114
+ categories=("Balancing", "Bids", "Offered Bids"),
115
+ ),
116
+ Report(
117
+ id="direction_of_balancing",
118
+ title="DSB (Direction of System Balancing) (legacy)",
119
+ resolutions=("PT15M",),
120
+ categories=("Legacy",),
121
+ ),
122
+ Report(
123
+ id="direction_of_balancing_v2",
124
+ title="DSB (Direction of System Balancing)",
125
+ resolutions=("PT15M",),
126
+ categories=("Balancing", "Imbalances"),
127
+ ),
128
+ Report(
129
+ id="er_mfrr_bid_prices",
130
+ title="ER mFRR bid prices",
131
+ resolutions=("PT15M",),
132
+ categories=("Legacy",),
133
+ ),
134
+ Report(
135
+ id="er_mfrr_bid_volumes",
136
+ title="ER mFRR bid volumes",
137
+ resolutions=("PT15M",),
138
+ categories=("Legacy",),
139
+ ),
140
+ Report(
141
+ id="fcr_reserve_bid_price",
142
+ title="Price of FCR reserve bids",
143
+ resolutions=("PT15M",),
144
+ categories=("Balancing", "Bids"),
145
+ ),
146
+ Report(
147
+ id="imbalance_prices",
148
+ title="Imbalance prices",
149
+ resolutions=("PT15M",),
150
+ categories=("Balancing", "Balancing and Imbalance Prices"),
151
+ ),
152
+ Report(
153
+ id="imbalance_volumes",
154
+ title="Imbalance volumes (legacy)",
155
+ resolutions=("PT15M",),
156
+ categories=("Legacy",),
157
+ ),
158
+ Report(
159
+ id="imbalance_volumes_v2",
160
+ title="Imbalance volumes",
161
+ resolutions=("PT15M",),
162
+ categories=("Balancing", "Imbalances"),
163
+ ),
164
+ Report(
165
+ id="increased_demands",
166
+ title="Increased demands",
167
+ resolutions=("PT15M",),
168
+ categories=("Reserves",),
169
+ ),
170
+ Report(
171
+ id="local_marginal_price_afrr",
172
+ title="Local marginal price aFRR",
173
+ resolutions=("PT15M",),
174
+ categories=("Balancing", "Balancing and Imbalance Prices"),
175
+ ),
176
+ Report(
177
+ id="local_marginal_price_mfrr",
178
+ title="Local marginal price mFRR",
179
+ resolutions=("PT15M",),
180
+ categories=("Balancing", "Balancing and Imbalance Prices"),
181
+ ),
182
+ Report(
183
+ id="local_mfrr_er_bid_volumes",
184
+ title="Local mFRR (ER) bid volumes",
185
+ resolutions=("PT15M",),
186
+ categories=("Balancing", "Bids", "Offered Bids"),
187
+ ),
188
+ Report(
189
+ id="mfrr_bid_prices",
190
+ title="mFRR bid prices",
191
+ resolutions=("PT15M",),
192
+ categories=("Legacy",),
193
+ ),
194
+ Report(
195
+ id="mfrr_bid_volumes",
196
+ title="mFRR bid volumes",
197
+ resolutions=("PT1H",),
198
+ categories=("Legacy",),
199
+ ),
200
+ Report(
201
+ id="mfrr_satisfied_demand_price",
202
+ title="mFRR satisfied demand price",
203
+ resolutions=("PT15M",),
204
+ categories=("Balancing", "Balancing and Imbalance Prices"),
205
+ ),
206
+ Report(
207
+ id="netted_exchanged_volumes",
208
+ title="Netted and exchanged volumes mFRR",
209
+ resolutions=("PT15M",),
210
+ categories=("Exchange",),
211
+ ),
212
+ Report(
213
+ id="netted_exchanged_volumes_afrr",
214
+ title="Netted and exchanged volumes aFRR",
215
+ resolutions=("PT15M",),
216
+ categories=("Exchange",),
217
+ ),
218
+ Report(
219
+ id="neutrality",
220
+ title="Neutrality Component (legacy)",
221
+ resolutions=("PT15M",),
222
+ categories=("Legacy",),
223
+ ),
224
+ Report(
225
+ id="neutrality_component",
226
+ title="Neutrality Component",
227
+ resolutions=("PT15M",),
228
+ categories=("Balancing", "Balancing and Imbalance Prices"),
229
+ ),
230
+ Report(
231
+ id="normal_activations_da_mfrr",
232
+ title="Normal activations - DA mFRR",
233
+ resolutions=("PT15M",),
234
+ categories=("Balancing", "Activations", "Normal Activation"),
235
+ ),
236
+ Report(
237
+ id="normal_activations_er_mfrr",
238
+ title="Normal activations - ER mFRR",
239
+ resolutions=("PT15M",),
240
+ categories=("Legacy",),
241
+ ),
242
+ Report(
243
+ id="normal_activations_local_mfrr",
244
+ title="Normal activations - Local mFRR",
245
+ resolutions=("PT15M",),
246
+ categories=("Balancing", "Activations", "Normal Activation"),
247
+ ),
248
+ Report(
249
+ id="normal_activations_mfrr",
250
+ title="Normal activations - mFRR",
251
+ resolutions=("PT15M",),
252
+ categories=("Legacy",),
253
+ ),
254
+ Report(
255
+ id="normal_activations_sa_mfrr",
256
+ title="Normal activations - SA mFRR",
257
+ resolutions=("PT15M",),
258
+ categories=("Balancing", "Activations", "Normal Activation"),
259
+ ),
260
+ Report(
261
+ id="normal_activations_total",
262
+ title="Normal activations - Total",
263
+ resolutions=("PT15M",),
264
+ categories=("Legacy",),
265
+ ),
266
+ Report(
267
+ id="price_afrr_reserve_bids",
268
+ title="Price of aFRR reserve bids",
269
+ resolutions=("PT15M",),
270
+ categories=("Balancing", "Bids"),
271
+ ),
272
+ Report(
273
+ id="price_mfrr_reserve_bids",
274
+ title="Price of mFRR reserve bids",
275
+ resolutions=("PT15M",),
276
+ categories=("Balancing", "Bids"),
277
+ ),
278
+ Report(
279
+ id="price_procured_reserves",
280
+ title='Price of procured reserves ("Description" tab includes link to 60-min)',
281
+ resolutions=("PT15M",),
282
+ categories=("Reserves",),
283
+ ),
284
+ Report(
285
+ id="price_procured_reserves_legacy",
286
+ title="Price of procured reserves (Legacy)",
287
+ resolutions=("PT1H",),
288
+ categories=("Legacy",),
289
+ ),
290
+ Report(
291
+ id="procured_reserves",
292
+ title='Volume of procured reserves ("Description" tab includes link to 60-min)',
293
+ resolutions=("PT15M",),
294
+ categories=("Reserves",),
295
+ ),
296
+ Report(
297
+ id="procured_reserves_legacy",
298
+ title="Volume of procured reserves (Legacy)",
299
+ resolutions=("PT1H",),
300
+ categories=("Legacy",),
301
+ ),
302
+ Report(
303
+ id="reserves_demand",
304
+ title='Demand for balancing reserves ("Description" tab includes link to 60-min)',
305
+ resolutions=("PT15M",),
306
+ categories=("Reserves",),
307
+ ),
308
+ Report(
309
+ id="reserves_demand_legacy",
310
+ title="Demand for balancing reserves (Legacy)",
311
+ resolutions=("PT1H",),
312
+ categories=("Legacy",),
313
+ ),
314
+ Report(
315
+ id="sa_mfrr_bid_prices",
316
+ title="SA mFRR bid prices",
317
+ resolutions=("PT15M",),
318
+ categories=("Balancing", "Bids", "Offered Prices"),
319
+ ),
320
+ Report(
321
+ id="sa_mfrr_bid_volumes",
322
+ title="SA mFRR bid volumes",
323
+ resolutions=("PT15M",),
324
+ categories=("Balancing", "Bids", "Offered Bids"),
325
+ ),
326
+ Report(
327
+ id="satisfied_demand_afrr",
328
+ title="Total satisfied demand for balancing purposes from automatic FRR",
329
+ resolutions=("PT15M",),
330
+ categories=("Demands",),
331
+ ),
332
+ Report(
333
+ id="special_activations_total",
334
+ title="Special activations - Total",
335
+ resolutions=("PT15M",),
336
+ categories=("Legacy",),
337
+ ),
338
+ Report(
339
+ id="special_activations_total_mfrr",
340
+ title="Special activations - Total mFRR",
341
+ resolutions=("PT15M",),
342
+ categories=("Balancing", "Activations", "Special Activation"),
343
+ ),
344
+ Report(
345
+ id="system_services",
346
+ title="System services",
347
+ resolutions=("PT15M",),
348
+ categories=("Legacy",),
349
+ ),
350
+ Report(
351
+ id="total_satisfied_demand_for_balancing_purposes",
352
+ title="Total satisfied demand for balancing purposes mFRR",
353
+ resolutions=("PT15M",),
354
+ categories=("Demands",),
355
+ ),
356
+ Report(
357
+ id="total_satisfied_demand_from_nonbaltic_tsos",
358
+ title="Total satisfied demand from non-baltic TSO",
359
+ resolutions=("PT15M",),
360
+ categories=("Demands",),
361
+ ),
362
+ Report(
363
+ id="unavailable_afrr_bid_volumes",
364
+ title="Unavailable aFRR bid volumes",
365
+ resolutions=("PT15M",),
366
+ categories=("Balancing", "Bids", "Offered Bids"),
367
+ ),
368
+ Report(
369
+ id="unavailable_mfrr_bid_volumes",
370
+ title="Unavailable mFRR bid volumes (legacy)",
371
+ resolutions=("PT15M",),
372
+ categories=("Legacy",),
373
+ ),
374
+ Report(
375
+ id="unavailable_mfrr_bid_volumes_v2",
376
+ title="Unavailable mFRR bid volumes",
377
+ resolutions=("PT15M",),
378
+ categories=("Balancing", "Bids", "Offered Bids"),
379
+ ),
380
+ Report(
381
+ id="volume_of_back_up_reserve_bids",
382
+ title="Volume of back-up reserve bids",
383
+ resolutions=("PT15M",),
384
+ categories=("Balancing", "Bids"),
385
+ ),
386
+ Report(
387
+ id="volume_of_demand_reduction_reserve_bids",
388
+ title="Volume of demand reduction reserve bids",
389
+ resolutions=("PT15M",),
390
+ categories=("Balancing", "Bids"),
391
+ ),
392
+ Report(
393
+ id="volume_of_reserve_bids",
394
+ title="Volume of reserve bids",
395
+ resolutions=("PT15M",),
396
+ categories=("Balancing", "Bids"),
397
+ ),
398
+ Report(
399
+ id="volumes_afrr",
400
+ title="aFRR bid volumes",
401
+ resolutions=("PT15M",),
402
+ categories=("Balancing",),
403
+ ),
404
+ )