python-entsoe 0.2.0__tar.gz → 0.3.1__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 (50) hide show
  1. python_entsoe-0.3.1/.devcontainer/devcontainer.json +16 -0
  2. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/.github/workflows/publish.yml +1 -1
  3. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/.gitignore +5 -0
  4. python_entsoe-0.3.1/CLAUDE.md +46 -0
  5. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/PKG-INFO +14 -40
  6. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/README.md +13 -39
  7. python_entsoe-0.3.1/examples/ancillary_services.ipynb +767 -0
  8. python_entsoe-0.3.1/examples/balancing.ipynb +347 -0
  9. python_entsoe-0.3.1/examples/generation.ipynb +392 -0
  10. python_entsoe-0.3.1/examples/generation_per_plant.ipynb +462 -0
  11. python_entsoe-0.3.1/examples/generator_level_germany.ipynb +208 -0
  12. python_entsoe-0.3.1/examples/load.ipynb +343 -0
  13. python_entsoe-0.3.1/examples/prices.ipynb +351 -0
  14. python_entsoe-0.3.1/examples/transmission.ipynb +417 -0
  15. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/pyproject.toml +4 -2
  16. python_entsoe-0.3.1/src/entsoe/__init__.py +41 -0
  17. python_entsoe-0.3.1/src/entsoe/_mappings.py +459 -0
  18. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/_xml.py +25 -7
  19. python_entsoe-0.3.1/src/entsoe/namespaces/balancing.py +177 -0
  20. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/generation.py +14 -13
  21. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_balancing.py +9 -0
  22. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_generation.py +2 -2
  23. python_entsoe-0.3.1/uv.lock +2442 -0
  24. python_entsoe-0.2.0/examples/balancing.ipynb +0 -166
  25. python_entsoe-0.2.0/examples/generation.ipynb +0 -207
  26. python_entsoe-0.2.0/examples/load.ipynb +0 -174
  27. python_entsoe-0.2.0/examples/prices.ipynb +0 -164
  28. python_entsoe-0.2.0/examples/transmission.ipynb +0 -219
  29. python_entsoe-0.2.0/scripts/generate_notebooks.py +0 -711
  30. python_entsoe-0.2.0/src/entsoe/__init__.py +0 -13
  31. python_entsoe-0.2.0/src/entsoe/_mappings.py +0 -145
  32. python_entsoe-0.2.0/src/entsoe/namespaces/balancing.py +0 -62
  33. python_entsoe-0.2.0/uv.lock +0 -1656
  34. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/.python-version +0 -0
  35. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/docs/data-availability.md +0 -0
  36. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/_http.py +0 -0
  37. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/client.py +0 -0
  38. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/exceptions.py +0 -0
  39. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/__init__.py +0 -0
  40. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/_base.py +0 -0
  41. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/load.py +0 -0
  42. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/prices.py +0 -0
  43. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/namespaces/transmission.py +0 -0
  44. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/src/entsoe/py.typed +0 -0
  45. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/__init__.py +0 -0
  46. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/conftest.py +0 -0
  47. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_load.py +0 -0
  48. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_prices.py +0 -0
  49. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_transmission.py +0 -0
  50. {python_entsoe-0.2.0 → python_entsoe-0.3.1}/tests/test_validation.py +0 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "python-entsoe",
3
+ "image": "mcr.microsoft.com/devcontainers/python:3.13",
4
+ "features": {
5
+ "ghcr.io/astral-sh/uv-devcontainer-features/uv": {}
6
+ },
7
+ "postCreateCommand": "uv sync --dev",
8
+ "customizations": {
9
+ "vscode": {
10
+ "extensions": [
11
+ "ms-python.python",
12
+ "ms-toolsai.jupyter"
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -2,7 +2,7 @@ name: Publish to PyPI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [main]
5
+ tags: ["v*"]
6
6
 
7
7
  jobs:
8
8
  publish:
@@ -36,3 +36,8 @@ htmlcov/
36
36
  # OS
37
37
  .DS_Store
38
38
  Thumbs.db
39
+ output/
40
+ examples/generators/
41
+
42
+ # Development & testing
43
+ random/
@@ -0,0 +1,46 @@
1
+ # python-entsoe
2
+
3
+ Python client for the ENTSO-E Transparency Platform API.
4
+
5
+ ## Environment
6
+
7
+ - **Python**: ≥3.13, managed with `uv`
8
+ - **API key**: stored in `.env` as `ENTSOE_API_KEY`
9
+ - Run scripts: `uv run python <script>`
10
+ - Run tests: `uv run pytest`
11
+
12
+ ## PyPI Publishing
13
+
14
+ Publishing is **tag-based only**. Pushing to `main` does NOT trigger a release.
15
+
16
+ ```bash
17
+ # 1. Bump version in pyproject.toml
18
+ # 2. Commit the version bump
19
+ # 3. Tag and push
20
+ git tag v0.3.0
21
+ git push origin main --tags
22
+ ```
23
+
24
+ The GitHub Actions workflow (`.github/workflows/publish.yml`) uses OIDC trusted publishing — no tokens needed.
25
+
26
+ ## Example Notebooks
27
+
28
+ Notebooks in `examples/` are **generated** — do not edit them directly.
29
+
30
+ ### Workflow
31
+
32
+ ```bash
33
+ # 1. Edit the notebook definitions
34
+ # → scripts/generate_notebooks.py
35
+
36
+ # 2. Generate clean notebooks (no outputs)
37
+ uv run python scripts/generate_notebooks.py
38
+
39
+ # 3. Generate + execute (saves outputs for GitHub rendering)
40
+ uv run python scripts/generate_notebooks.py --execute
41
+
42
+ # 4. Force re-execution (even if already executed)
43
+ uv run python scripts/generate_notebooks.py --execute --force
44
+ ```
45
+
46
+ Execution is **idempotent** — notebooks with existing outputs are skipped unless `--force` is passed. Requires `ENTSOE_API_KEY` in environment.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-entsoe
3
- Version: 0.2.0
3
+ Version: 0.3.1
4
4
  Summary: Python client for the ENTSO-E Transparency Platform API
5
5
  Project-URL: Repository, https://github.com/datons/python-entsoe
6
6
  Author-email: jsulopzs <jesus.lopez@datons.com>
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Classifier: Topic :: Scientific/Engineering
15
- Requires-Python: >=3.13
15
+ Requires-Python: >=3.10
16
16
  Requires-Dist: pandas>=2.0
17
17
  Requires-Dist: requests>=2.28
18
18
  Description-Content-Type: text/markdown
@@ -136,50 +136,19 @@ df = client.transmission.crossborder_flows(
136
136
  df = client.balancing.imbalance_prices(start, end, country="FR")
137
137
  ```
138
138
 
139
- ## Country Codes
139
+ ## Codes & Dimensions
140
140
 
141
- Use standard ISO codes. Some bidding zones have specific codes:
141
+ All ENTSO-E codes (areas, PSR types, process types, business types, price categories, etc.) are defined as structured registries in [`_mappings.py`](https://github.com/datons/python-entsoe/blob/main/src/entsoe/_mappings.py). Each entry has a `name` (DataFrame output), `slug` (programmatic identifier), and `description`.
142
142
 
143
- | Code | Area |
144
- |------|------|
145
- | `FR` | France |
146
- | `DE_LU` | Germany/Luxembourg (bidding zone) |
147
- | `ES` | Spain |
148
- | `NL` | Netherlands |
149
- | `BE` | Belgium |
150
- | `IT` | Italy |
151
- | `IT_NORTH` | Italy North |
152
- | `NO_1` .. `NO_5` | Norway zones |
153
- | `SE_1` .. `SE_4` | Sweden zones |
154
- | `DK_1`, `DK_2` | Denmark zones |
143
+ **Country codes** use standard ISO codes. Some bidding zones have specific codes (`DE_LU`, `IT_NORTH`, `NO_1`–`NO_5`, `SE_1`–`SE_4`, `DK_1`/`DK_2`).
155
144
 
156
145
  > **Note:** For day-ahead prices and balancing data, use `DE_LU` instead of `DE`. See [data availability notes](docs/data-availability.md) for details.
157
146
 
158
- Full list of 60+ supported areas in [`_mappings.py`](src/entsoe/_mappings.py).
159
-
160
- ## PSR Types (Fuel Types)
161
-
162
- Use PSR codes to filter generation by fuel type:
163
-
164
- | Code | Fuel Type |
165
- |------|-----------|
166
- | `B01` | Biomass |
167
- | `B04` | Fossil Gas |
168
- | `B05` | Fossil Hard coal |
169
- | `B06` | Fossil Oil |
170
- | `B10` | Hydro Pumped Storage |
171
- | `B11` | Hydro Run-of-river |
172
- | `B12` | Hydro Water Reservoir |
173
- | `B14` | Nuclear |
174
- | `B16` | Solar |
175
- | `B18` | Wind Offshore |
176
- | `B19` | Wind Onshore |
177
-
178
- Full list in [`_mappings.py`](src/entsoe/_mappings.py). Human-readable names available via:
147
+ **PSR types** filter generation by fuel type with codes like `B16` (Solar) or slugs like `"solar"`:
179
148
 
180
149
  ```python
181
- from entsoe._mappings import PSR_TYPES
182
- print(PSR_TYPES["B16"]) # "Solar"
150
+ from entsoe import PSR_TYPES
151
+ PSR_TYPES["B16"] # {'name': 'Solar', 'slug': 'solar', 'description': 'Solar'}
183
152
  ```
184
153
 
185
154
  ## Timestamps
@@ -239,10 +208,15 @@ See the [`examples/`](examples/) directory for Jupyter notebooks with plotly vis
239
208
  - [`transmission.ipynb`](examples/transmission.ipynb) — cross-border flows, bidirectional charts, NTC
240
209
  - [`balancing.ipynb`](examples/balancing.ipynb) — imbalance prices, multi-country, distribution
241
210
 
211
+ ## Documentation
212
+
213
+ - [**Code Registries**](https://github.com/datons/python-entsoe/blob/main/src/entsoe/_mappings.py) — All ENTSO-E codes and their meanings (areas, PSR types, process types, business types, price categories)
214
+ - [**Data Availability**](docs/data-availability.md) — Known issues, geographic coverage, and API quirks
215
+
242
216
  ## Development
243
217
 
244
218
  ```bash
245
- git clone https://github.com/jsulopzs/python-entsoe.git
219
+ git clone https://github.com/datons/python-entsoe.git
246
220
  cd python-entsoe
247
221
  uv sync
248
222
 
@@ -117,50 +117,19 @@ df = client.transmission.crossborder_flows(
117
117
  df = client.balancing.imbalance_prices(start, end, country="FR")
118
118
  ```
119
119
 
120
- ## Country Codes
121
-
122
- Use standard ISO codes. Some bidding zones have specific codes:
123
-
124
- | Code | Area |
125
- |------|------|
126
- | `FR` | France |
127
- | `DE_LU` | Germany/Luxembourg (bidding zone) |
128
- | `ES` | Spain |
129
- | `NL` | Netherlands |
130
- | `BE` | Belgium |
131
- | `IT` | Italy |
132
- | `IT_NORTH` | Italy North |
133
- | `NO_1` .. `NO_5` | Norway zones |
134
- | `SE_1` .. `SE_4` | Sweden zones |
135
- | `DK_1`, `DK_2` | Denmark zones |
120
+ ## Codes & Dimensions
136
121
 
137
- > **Note:** For day-ahead prices and balancing data, use `DE_LU` instead of `DE`. See [data availability notes](docs/data-availability.md) for details.
138
-
139
- Full list of 60+ supported areas in [`_mappings.py`](src/entsoe/_mappings.py).
140
-
141
- ## PSR Types (Fuel Types)
122
+ All ENTSO-E codes (areas, PSR types, process types, business types, price categories, etc.) are defined as structured registries in [`_mappings.py`](https://github.com/datons/python-entsoe/blob/main/src/entsoe/_mappings.py). Each entry has a `name` (DataFrame output), `slug` (programmatic identifier), and `description`.
142
123
 
143
- Use PSR codes to filter generation by fuel type:
124
+ **Country codes** — use standard ISO codes. Some bidding zones have specific codes (`DE_LU`, `IT_NORTH`, `NO_1`–`NO_5`, `SE_1`–`SE_4`, `DK_1`/`DK_2`).
144
125
 
145
- | Code | Fuel Type |
146
- |------|-----------|
147
- | `B01` | Biomass |
148
- | `B04` | Fossil Gas |
149
- | `B05` | Fossil Hard coal |
150
- | `B06` | Fossil Oil |
151
- | `B10` | Hydro Pumped Storage |
152
- | `B11` | Hydro Run-of-river |
153
- | `B12` | Hydro Water Reservoir |
154
- | `B14` | Nuclear |
155
- | `B16` | Solar |
156
- | `B18` | Wind Offshore |
157
- | `B19` | Wind Onshore |
126
+ > **Note:** For day-ahead prices and balancing data, use `DE_LU` instead of `DE`. See [data availability notes](docs/data-availability.md) for details.
158
127
 
159
- Full list in [`_mappings.py`](src/entsoe/_mappings.py). Human-readable names available via:
128
+ **PSR types** filter generation by fuel type with codes like `B16` (Solar) or slugs like `"solar"`:
160
129
 
161
130
  ```python
162
- from entsoe._mappings import PSR_TYPES
163
- print(PSR_TYPES["B16"]) # "Solar"
131
+ from entsoe import PSR_TYPES
132
+ PSR_TYPES["B16"] # {'name': 'Solar', 'slug': 'solar', 'description': 'Solar'}
164
133
  ```
165
134
 
166
135
  ## Timestamps
@@ -220,10 +189,15 @@ See the [`examples/`](examples/) directory for Jupyter notebooks with plotly vis
220
189
  - [`transmission.ipynb`](examples/transmission.ipynb) — cross-border flows, bidirectional charts, NTC
221
190
  - [`balancing.ipynb`](examples/balancing.ipynb) — imbalance prices, multi-country, distribution
222
191
 
192
+ ## Documentation
193
+
194
+ - [**Code Registries**](https://github.com/datons/python-entsoe/blob/main/src/entsoe/_mappings.py) — All ENTSO-E codes and their meanings (areas, PSR types, process types, business types, price categories)
195
+ - [**Data Availability**](docs/data-availability.md) — Known issues, geographic coverage, and API quirks
196
+
223
197
  ## Development
224
198
 
225
199
  ```bash
226
- git clone https://github.com/jsulopzs/python-entsoe.git
200
+ git clone https://github.com/datons/python-entsoe.git
227
201
  cd python-entsoe
228
202
  uv sync
229
203