balancing-services 2.2.0__tar.gz → 2.4.0__tar.gz

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.
Files changed (130) hide show
  1. {balancing_services-2.2.0 → balancing_services-2.4.0}/PKG-INFO +14 -21
  2. {balancing_services-2.2.0 → balancing_services-2.4.0}/README.md +13 -20
  3. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_activated_volume_history.py +332 -0
  4. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_offered_volume_history.py +332 -0
  5. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_price_history.py +326 -0
  6. balancing_services-2.4.0/balancing_services/api/default/get_imbalance_total_volume_history.py +321 -0
  7. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/__init__.py +34 -0
  8. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_history.py +141 -0
  9. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_history_response.py +132 -0
  10. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_revision.py +84 -0
  11. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_history.py +141 -0
  12. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_history_response.py +132 -0
  13. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_revision.py +84 -0
  14. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_history.py +146 -0
  15. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_history_response.py +128 -0
  16. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_revision.py +84 -0
  17. balancing_services-2.4.0/balancing_services/models/imbalance_total_volume_history.py +97 -0
  18. balancing_services-2.4.0/balancing_services/models/imbalance_total_volume_history_response.py +128 -0
  19. balancing_services-2.4.0/balancing_services/models/total_imbalance_volume_revision.py +100 -0
  20. {balancing_services-2.2.0 → balancing_services-2.4.0}/examples/basic_usage.py +1 -3
  21. {balancing_services-2.2.0 → balancing_services-2.4.0}/examples/error_handling.py +3 -5
  22. {balancing_services-2.2.0 → balancing_services-2.4.0}/examples/pagination_example.py +2 -7
  23. {balancing_services-2.2.0 → balancing_services-2.4.0}/fix_enum_validator_casts.py +1 -0
  24. {balancing_services-2.2.0 → balancing_services-2.4.0}/pyproject.toml +1 -1
  25. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/conftest.py +1 -3
  26. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_async.py +3 -13
  27. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_basic.py +99 -15
  28. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_datetime_compat.py +1 -3
  29. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_integration.py +727 -418
  30. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_procured_at_none_handling.py +2 -0
  31. {balancing_services-2.2.0 → balancing_services-2.4.0}/tests/test_readme_execution.py +15 -37
  32. {balancing_services-2.2.0 → balancing_services-2.4.0}/.env.sample +0 -0
  33. {balancing_services-2.2.0 → balancing_services-2.4.0}/.gitignore +0 -0
  34. {balancing_services-2.2.0 → balancing_services-2.4.0}/LICENSE +0 -0
  35. {balancing_services-2.2.0 → balancing_services-2.4.0}/PUBLISHING.md +0 -0
  36. {balancing_services-2.2.0 → balancing_services-2.4.0}/RELEASE_CHECKLIST.md +0 -0
  37. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/__init__.py +0 -0
  38. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/__init__.py +0 -0
  39. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/__init__.py +0 -0
  40. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_bids.py +0 -0
  41. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_demand.py +0 -0
  42. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_prices.py +0 -0
  43. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_procured_volumes.py +0 -0
  44. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_activated_volumes.py +0 -0
  45. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_bids.py +0 -0
  46. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_demand.py +0 -0
  47. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_offered_volumes.py +0 -0
  48. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_prices.py +0 -0
  49. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_satisfied_demand.py +0 -0
  50. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_available_capacity.py +0 -0
  51. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_energy_volumes.py +0 -0
  52. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_marginal_prices.py +0 -0
  53. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_zonal_capacity_allocation.py +0 -0
  54. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_current_imbalance_total_volumes.py +0 -0
  55. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_day_ahead_energy_prices.py +0 -0
  56. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_price_forecasts.py +0 -0
  57. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_price_history.py +0 -0
  58. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_prices.py +0 -0
  59. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_total_volumes.py +0 -0
  60. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/client.py +0 -0
  61. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/errors.py +0 -0
  62. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/activation_type.py +0 -0
  63. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/area.py +0 -0
  64. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bid_period.py +0 -0
  65. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bids.py +0 -0
  66. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bids_response.py +0 -0
  67. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demand.py +0 -0
  68. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demands.py +0 -0
  69. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demands_response.py +0 -0
  70. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_price.py +0 -0
  71. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_prices.py +0 -0
  72. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_prices_response.py +0 -0
  73. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volume.py +0 -0
  74. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volumes.py +0 -0
  75. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volumes_response.py +0 -0
  76. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bid_period.py +0 -0
  77. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bids.py +0 -0
  78. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bids_response.py +0 -0
  79. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_price.py +0 -0
  80. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_prices.py +0 -0
  81. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_prices_response.py +0 -0
  82. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volume.py +0 -0
  83. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volumes.py +0 -0
  84. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volumes_response.py +0 -0
  85. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/bid_status.py +0 -0
  86. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/capacity_bid.py +0 -0
  87. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity.py +0 -0
  88. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity_response.py +0 -0
  89. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity_value.py +0 -0
  90. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_energy_volumes.py +0 -0
  91. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_energy_volumes_response.py +0 -0
  92. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_price.py +0 -0
  93. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_prices.py +0 -0
  94. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_prices_response.py +0 -0
  95. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_zonal_capacity_allocation_response.py +0 -0
  96. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/cross_zonal_volumes.py +0 -0
  97. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/currency.py +0 -0
  98. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_price.py +0 -0
  99. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_prices.py +0 -0
  100. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_prices_response.py +0 -0
  101. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/demand_basis.py +0 -0
  102. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/direction.py +0 -0
  103. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/eic_code.py +0 -0
  104. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/energy_bid.py +0 -0
  105. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_direction.py +0 -0
  106. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price.py +0 -0
  107. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecast.py +0 -0
  108. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecast_quantile.py +0 -0
  109. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecasts.py +0 -0
  110. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecasts_response.py +0 -0
  111. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_history.py +0 -0
  112. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_history_response.py +0 -0
  113. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_revision.py +0 -0
  114. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_prices.py +0 -0
  115. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_prices_response.py +0 -0
  116. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volumes.py +0 -0
  117. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volumes_response.py +0 -0
  118. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/period.py +0 -0
  119. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/problem.py +0 -0
  120. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/procurement.py +0 -0
  121. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/reserve_type.py +0 -0
  122. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/total_imbalance_direction.py +0 -0
  123. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/models/total_imbalance_volume.py +0 -0
  124. {balancing_services-2.2.0 → balancing_services-2.4.0}/balancing_services/types.py +0 -0
  125. {balancing_services-2.2.0 → balancing_services-2.4.0}/check.sh +0 -0
  126. {balancing_services-2.2.0 → balancing_services-2.4.0}/config.yaml +0 -0
  127. {balancing_services-2.2.0 → balancing_services-2.4.0}/generate-pyproject.sh +0 -0
  128. {balancing_services-2.2.0 → balancing_services-2.4.0}/generate.sh +0 -0
  129. {balancing_services-2.2.0 → balancing_services-2.4.0}/pyproject.toml.draft +0 -0
  130. {balancing_services-2.2.0 → balancing_services-2.4.0}/test-and-publish.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: balancing-services
3
- Version: 2.2.0
3
+ Version: 2.4.0
4
4
  Summary: Official Python client for accessing European electricity balancing market data via the Balancing Services REST API
5
5
  Project-URL: Homepage, https://balancing.services
6
6
  Project-URL: Documentation, https://api.balancing.services/v2/documentation
@@ -74,10 +74,7 @@ from balancing_services import AuthenticatedClient
74
74
  from balancing_services.api.default import get_imbalance_prices
75
75
 
76
76
  # Create an authenticated client
77
- client = AuthenticatedClient(
78
- base_url="https://api.balancing.services/v2",
79
- token="YOUR_API_TOKEN"
80
- )
77
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
81
78
 
82
79
  # Get imbalance prices for Estonia. Enum-typed parameters take plain string
83
80
  # values (e.g. area="EE") — see "Data Models" below.
@@ -85,7 +82,7 @@ response = get_imbalance_prices.sync_detailed(
85
82
  client=client,
86
83
  area="EE",
87
84
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
88
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
85
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
89
86
  )
90
87
 
91
88
  if response.status_code == 200:
@@ -108,10 +105,7 @@ Include your token when creating the client:
108
105
  ```python
109
106
  from balancing_services import AuthenticatedClient
110
107
 
111
- client = AuthenticatedClient(
112
- base_url="https://api.balancing.services/v2",
113
- token="YOUR_API_TOKEN"
114
- )
108
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
115
109
  ```
116
110
 
117
111
  ## Usage Examples
@@ -133,7 +127,7 @@ response = get_balancing_energy_bids.sync_detailed(
133
127
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
134
128
  period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
135
129
  reserve_type="aFRR",
136
- limit=100
130
+ limit=100,
137
131
  )
138
132
 
139
133
  if response.status_code == 200:
@@ -155,7 +149,7 @@ if response.status_code == 200:
155
149
  period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
156
150
  reserve_type="aFRR",
157
151
  cursor=data.next_cursor,
158
- limit=100
152
+ limit=100,
159
153
  )
160
154
  ```
161
155
 
@@ -168,23 +162,22 @@ from datetime import datetime
168
162
  from balancing_services import AuthenticatedClient
169
163
  from balancing_services.api.default import get_imbalance_prices
170
164
 
165
+
171
166
  async def fetch_prices():
172
- client = AuthenticatedClient(
173
- base_url="https://api.balancing.services/v2",
174
- token="YOUR_TOKEN"
175
- )
167
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_TOKEN")
176
168
 
177
169
  response = await get_imbalance_prices.asyncio_detailed(
178
170
  client=client,
179
171
  area="EE",
180
172
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
181
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
173
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
182
174
  )
183
175
 
184
176
  if response.status_code == 200:
185
177
  return response.parsed
186
178
  return None
187
179
 
180
+
188
181
  # Run async function
189
182
  prices = asyncio.run(fetch_prices())
190
183
  ```
@@ -203,7 +196,7 @@ response = get_imbalance_prices.sync_detailed(
203
196
  client=client,
204
197
  area="EE",
205
198
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
206
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
199
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
207
200
  )
208
201
 
209
202
  if response.status_code == 200:
@@ -400,7 +393,7 @@ if response.status_code == 400:
400
393
  client = AuthenticatedClient(
401
394
  base_url="https://api.balancing.services/v2",
402
395
  token="YOUR_TOKEN",
403
- timeout=30.0 # Increase from default
396
+ timeout=30.0, # Increase from default
404
397
  )
405
398
  ```
406
399
  - Reduce the date range in your request
@@ -415,8 +408,8 @@ client = AuthenticatedClient(
415
408
  no enum member to import:
416
409
  ```python
417
410
  # Correct
418
- area="EE"
419
- reserve_type="aFRR"
411
+ area = "EE"
412
+ reserve_type = "aFRR"
420
413
  ```
421
414
 
422
415
  The accepted values for each enum are available as a `*_VALUES` set if you need
@@ -38,10 +38,7 @@ from balancing_services import AuthenticatedClient
38
38
  from balancing_services.api.default import get_imbalance_prices
39
39
 
40
40
  # Create an authenticated client
41
- client = AuthenticatedClient(
42
- base_url="https://api.balancing.services/v2",
43
- token="YOUR_API_TOKEN"
44
- )
41
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
45
42
 
46
43
  # Get imbalance prices for Estonia. Enum-typed parameters take plain string
47
44
  # values (e.g. area="EE") — see "Data Models" below.
@@ -49,7 +46,7 @@ response = get_imbalance_prices.sync_detailed(
49
46
  client=client,
50
47
  area="EE",
51
48
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
52
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
49
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
53
50
  )
54
51
 
55
52
  if response.status_code == 200:
@@ -72,10 +69,7 @@ Include your token when creating the client:
72
69
  ```python
73
70
  from balancing_services import AuthenticatedClient
74
71
 
75
- client = AuthenticatedClient(
76
- base_url="https://api.balancing.services/v2",
77
- token="YOUR_API_TOKEN"
78
- )
72
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
79
73
  ```
80
74
 
81
75
  ## Usage Examples
@@ -97,7 +91,7 @@ response = get_balancing_energy_bids.sync_detailed(
97
91
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
98
92
  period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
99
93
  reserve_type="aFRR",
100
- limit=100
94
+ limit=100,
101
95
  )
102
96
 
103
97
  if response.status_code == 200:
@@ -119,7 +113,7 @@ if response.status_code == 200:
119
113
  period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
120
114
  reserve_type="aFRR",
121
115
  cursor=data.next_cursor,
122
- limit=100
116
+ limit=100,
123
117
  )
124
118
  ```
125
119
 
@@ -132,23 +126,22 @@ from datetime import datetime
132
126
  from balancing_services import AuthenticatedClient
133
127
  from balancing_services.api.default import get_imbalance_prices
134
128
 
129
+
135
130
  async def fetch_prices():
136
- client = AuthenticatedClient(
137
- base_url="https://api.balancing.services/v2",
138
- token="YOUR_TOKEN"
139
- )
131
+ client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_TOKEN")
140
132
 
141
133
  response = await get_imbalance_prices.asyncio_detailed(
142
134
  client=client,
143
135
  area="EE",
144
136
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
145
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
137
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
146
138
  )
147
139
 
148
140
  if response.status_code == 200:
149
141
  return response.parsed
150
142
  return None
151
143
 
144
+
152
145
  # Run async function
153
146
  prices = asyncio.run(fetch_prices())
154
147
  ```
@@ -167,7 +160,7 @@ response = get_imbalance_prices.sync_detailed(
167
160
  client=client,
168
161
  area="EE",
169
162
  period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
170
- period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
163
+ period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
171
164
  )
172
165
 
173
166
  if response.status_code == 200:
@@ -364,7 +357,7 @@ if response.status_code == 400:
364
357
  client = AuthenticatedClient(
365
358
  base_url="https://api.balancing.services/v2",
366
359
  token="YOUR_TOKEN",
367
- timeout=30.0 # Increase from default
360
+ timeout=30.0, # Increase from default
368
361
  )
369
362
  ```
370
363
  - Reduce the date range in your request
@@ -379,8 +372,8 @@ client = AuthenticatedClient(
379
372
  no enum member to import:
380
373
  ```python
381
374
  # Correct
382
- area="EE"
383
- reserve_type="aFRR"
375
+ area = "EE"
376
+ reserve_type = "aFRR"
384
377
  ```
385
378
 
386
379
  The accepted values for each enum are available as a `*_VALUES` set if you need
@@ -0,0 +1,332 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.area import Area
10
+ from ...models.balancing_energy_activated_volume_history_response import (
11
+ BalancingEnergyActivatedVolumeHistoryResponse,
12
+ )
13
+ from ...models.problem import Problem
14
+ from ...models.reserve_type import ReserveType
15
+ from ...types import UNSET, Response, Unset
16
+
17
+
18
+ def _get_kwargs(
19
+ *,
20
+ area: Area,
21
+ period_start_at: datetime.datetime,
22
+ period_end_at: datetime.datetime,
23
+ reserve_type: ReserveType,
24
+ cursor: str | Unset = UNSET,
25
+ limit: int | Unset = 100,
26
+ updated_since: datetime.datetime | Unset = UNSET,
27
+ ) -> dict[str, Any]:
28
+
29
+ params: dict[str, Any] = {}
30
+
31
+ json_area: str = area
32
+ params["area"] = json_area
33
+
34
+ json_period_start_at = period_start_at.isoformat()
35
+ params["period-start-at"] = json_period_start_at
36
+
37
+ json_period_end_at = period_end_at.isoformat()
38
+ params["period-end-at"] = json_period_end_at
39
+
40
+ json_reserve_type: str = reserve_type
41
+ params["reserve-type"] = json_reserve_type
42
+
43
+ params["cursor"] = cursor
44
+
45
+ params["limit"] = limit
46
+
47
+ json_updated_since: str | Unset = UNSET
48
+ if not isinstance(updated_since, Unset):
49
+ json_updated_since = updated_since.isoformat()
50
+ params["updated-since"] = json_updated_since
51
+
52
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
53
+
54
+ _kwargs: dict[str, Any] = {
55
+ "method": "get",
56
+ "url": "/balancing/energy/activated-volumes/history",
57
+ "params": params,
58
+ }
59
+
60
+ return _kwargs
61
+
62
+
63
+ def _parse_response(
64
+ *, client: AuthenticatedClient | Client, response: httpx.Response
65
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
66
+ if response.status_code == 200:
67
+ response_200 = BalancingEnergyActivatedVolumeHistoryResponse.from_dict(
68
+ response.json()
69
+ )
70
+
71
+ return response_200
72
+
73
+ if response.status_code == 400:
74
+ response_400 = Problem.from_dict(response.json())
75
+
76
+ return response_400
77
+
78
+ if response.status_code == 401:
79
+ response_401 = Problem.from_dict(response.json())
80
+
81
+ return response_401
82
+
83
+ if response.status_code == 403:
84
+ response_403 = Problem.from_dict(response.json())
85
+
86
+ return response_403
87
+
88
+ if response.status_code == 404:
89
+ response_404 = Problem.from_dict(response.json())
90
+
91
+ return response_404
92
+
93
+ if response.status_code == 429:
94
+ response_429 = Problem.from_dict(response.json())
95
+
96
+ return response_429
97
+
98
+ if response.status_code == 500:
99
+ response_500 = Problem.from_dict(response.json())
100
+
101
+ return response_500
102
+
103
+ if response.status_code == 501:
104
+ response_501 = Problem.from_dict(response.json())
105
+
106
+ return response_501
107
+
108
+ if client.raise_on_unexpected_status:
109
+ raise errors.UnexpectedStatus(response.status_code, response.content)
110
+ else:
111
+ return None
112
+
113
+
114
+ def _build_response(
115
+ *, client: AuthenticatedClient | Client, response: httpx.Response
116
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
117
+ return Response(
118
+ status_code=HTTPStatus(response.status_code),
119
+ content=response.content,
120
+ headers=response.headers,
121
+ parsed=_parse_response(client=client, response=response),
122
+ )
123
+
124
+
125
+ def sync_detailed(
126
+ *,
127
+ client: AuthenticatedClient | Client,
128
+ area: Area,
129
+ period_start_at: datetime.datetime,
130
+ period_end_at: datetime.datetime,
131
+ reserve_type: ReserveType,
132
+ cursor: str | Unset = UNSET,
133
+ limit: int | Unset = 100,
134
+ updated_since: datetime.datetime | Unset = UNSET,
135
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
136
+ """Get the revision history of the activated balancing energy volumes for an area
137
+
138
+ **Experimental** - This endpoint is under active development and may change without notice.
139
+
140
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
141
+ reached their current values: the sequence of values held for a period, each stamped with the
142
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
143
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
144
+ ascending by `observedAt`.
145
+
146
+ Args:
147
+ area (Area): Area code
148
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
149
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
150
+ reserve_type (ReserveType): Reserve type
151
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
152
+ limit (int | Unset): Default: 100. Example: 100.
153
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]
161
+ """
162
+
163
+ kwargs = _get_kwargs(
164
+ area=area,
165
+ period_start_at=period_start_at,
166
+ period_end_at=period_end_at,
167
+ reserve_type=reserve_type,
168
+ cursor=cursor,
169
+ limit=limit,
170
+ updated_since=updated_since,
171
+ )
172
+
173
+ response = client.get_httpx_client().request(
174
+ **kwargs,
175
+ )
176
+
177
+ return _build_response(client=client, response=response)
178
+
179
+
180
+ def sync(
181
+ *,
182
+ client: AuthenticatedClient | Client,
183
+ area: Area,
184
+ period_start_at: datetime.datetime,
185
+ period_end_at: datetime.datetime,
186
+ reserve_type: ReserveType,
187
+ cursor: str | Unset = UNSET,
188
+ limit: int | Unset = 100,
189
+ updated_since: datetime.datetime | Unset = UNSET,
190
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
191
+ """Get the revision history of the activated balancing energy volumes for an area
192
+
193
+ **Experimental** - This endpoint is under active development and may change without notice.
194
+
195
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
196
+ reached their current values: the sequence of values held for a period, each stamped with the
197
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
198
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
199
+ ascending by `observedAt`.
200
+
201
+ Args:
202
+ area (Area): Area code
203
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
204
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
205
+ reserve_type (ReserveType): Reserve type
206
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
207
+ limit (int | Unset): Default: 100. Example: 100.
208
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
209
+
210
+ Raises:
211
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
212
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
213
+
214
+ Returns:
215
+ BalancingEnergyActivatedVolumeHistoryResponse | Problem
216
+ """
217
+
218
+ return sync_detailed(
219
+ client=client,
220
+ area=area,
221
+ period_start_at=period_start_at,
222
+ period_end_at=period_end_at,
223
+ reserve_type=reserve_type,
224
+ cursor=cursor,
225
+ limit=limit,
226
+ updated_since=updated_since,
227
+ ).parsed
228
+
229
+
230
+ async def asyncio_detailed(
231
+ *,
232
+ client: AuthenticatedClient | Client,
233
+ area: Area,
234
+ period_start_at: datetime.datetime,
235
+ period_end_at: datetime.datetime,
236
+ reserve_type: ReserveType,
237
+ cursor: str | Unset = UNSET,
238
+ limit: int | Unset = 100,
239
+ updated_since: datetime.datetime | Unset = UNSET,
240
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
241
+ """Get the revision history of the activated balancing energy volumes for an area
242
+
243
+ **Experimental** - This endpoint is under active development and may change without notice.
244
+
245
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
246
+ reached their current values: the sequence of values held for a period, each stamped with the
247
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
248
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
249
+ ascending by `observedAt`.
250
+
251
+ Args:
252
+ area (Area): Area code
253
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
254
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
255
+ reserve_type (ReserveType): Reserve type
256
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
257
+ limit (int | Unset): Default: 100. Example: 100.
258
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
259
+
260
+ Raises:
261
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
262
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
263
+
264
+ Returns:
265
+ Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]
266
+ """
267
+
268
+ kwargs = _get_kwargs(
269
+ area=area,
270
+ period_start_at=period_start_at,
271
+ period_end_at=period_end_at,
272
+ reserve_type=reserve_type,
273
+ cursor=cursor,
274
+ limit=limit,
275
+ updated_since=updated_since,
276
+ )
277
+
278
+ response = await client.get_async_httpx_client().request(**kwargs)
279
+
280
+ return _build_response(client=client, response=response)
281
+
282
+
283
+ async def asyncio(
284
+ *,
285
+ client: AuthenticatedClient | Client,
286
+ area: Area,
287
+ period_start_at: datetime.datetime,
288
+ period_end_at: datetime.datetime,
289
+ reserve_type: ReserveType,
290
+ cursor: str | Unset = UNSET,
291
+ limit: int | Unset = 100,
292
+ updated_since: datetime.datetime | Unset = UNSET,
293
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
294
+ """Get the revision history of the activated balancing energy volumes for an area
295
+
296
+ **Experimental** - This endpoint is under active development and may change without notice.
297
+
298
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
299
+ reached their current values: the sequence of values held for a period, each stamped with the
300
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
301
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
302
+ ascending by `observedAt`.
303
+
304
+ Args:
305
+ area (Area): Area code
306
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
307
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
308
+ reserve_type (ReserveType): Reserve type
309
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
310
+ limit (int | Unset): Default: 100. Example: 100.
311
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
312
+
313
+ Raises:
314
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
315
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
316
+
317
+ Returns:
318
+ BalancingEnergyActivatedVolumeHistoryResponse | Problem
319
+ """
320
+
321
+ return (
322
+ await asyncio_detailed(
323
+ client=client,
324
+ area=area,
325
+ period_start_at=period_start_at,
326
+ period_end_at=period_end_at,
327
+ reserve_type=reserve_type,
328
+ cursor=cursor,
329
+ limit=limit,
330
+ updated_since=updated_since,
331
+ )
332
+ ).parsed