python-entsoe 0.1.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.
- python_entsoe-0.1.0/.gitignore +38 -0
- python_entsoe-0.1.0/.python-version +1 -0
- python_entsoe-0.1.0/PKG-INFO +17 -0
- python_entsoe-0.1.0/README.md +0 -0
- python_entsoe-0.1.0/docs/data-availability.md +104 -0
- python_entsoe-0.1.0/examples/balancing.ipynb +8434 -0
- python_entsoe-0.1.0/examples/generation.ipynb +6762 -0
- python_entsoe-0.1.0/examples/load.ipynb +4656 -0
- python_entsoe-0.1.0/examples/prices.ipynb +6722 -0
- python_entsoe-0.1.0/examples/transmission.ipynb +5735 -0
- python_entsoe-0.1.0/pyproject.toml +44 -0
- python_entsoe-0.1.0/scripts/generate_notebooks.py +711 -0
- python_entsoe-0.1.0/src/entsoe/__init__.py +13 -0
- python_entsoe-0.1.0/src/entsoe/_http.py +201 -0
- python_entsoe-0.1.0/src/entsoe/_mappings.py +145 -0
- python_entsoe-0.1.0/src/entsoe/_xml.py +172 -0
- python_entsoe-0.1.0/src/entsoe/client.py +67 -0
- python_entsoe-0.1.0/src/entsoe/exceptions.py +30 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/__init__.py +15 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/_base.py +45 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/balancing.py +62 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/generation.py +128 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/load.py +62 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/prices.py +40 -0
- python_entsoe-0.1.0/src/entsoe/namespaces/transmission.py +93 -0
- python_entsoe-0.1.0/src/entsoe/py.typed +0 -0
- python_entsoe-0.1.0/tests/__init__.py +0 -0
- python_entsoe-0.1.0/tests/conftest.py +38 -0
- python_entsoe-0.1.0/tests/test_balancing.py +35 -0
- python_entsoe-0.1.0/tests/test_generation.py +57 -0
- python_entsoe-0.1.0/tests/test_load.py +49 -0
- python_entsoe-0.1.0/tests/test_prices.py +42 -0
- python_entsoe-0.1.0/tests/test_transmission.py +58 -0
- python_entsoe-0.1.0/tests/test_validation.py +47 -0
- python_entsoe-0.1.0/uv.lock +1656 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
*.egg
|
|
6
|
+
*.egg-info/
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
wheels/
|
|
10
|
+
*.whl
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
|
|
15
|
+
# Secrets
|
|
16
|
+
.env
|
|
17
|
+
|
|
18
|
+
# IDE
|
|
19
|
+
.idea/
|
|
20
|
+
.vscode/
|
|
21
|
+
*.swp
|
|
22
|
+
*.swo
|
|
23
|
+
*~
|
|
24
|
+
|
|
25
|
+
# Claude
|
|
26
|
+
.claude/
|
|
27
|
+
|
|
28
|
+
# Jupyter
|
|
29
|
+
.ipynb_checkpoints/
|
|
30
|
+
|
|
31
|
+
# Testing
|
|
32
|
+
.pytest_cache/
|
|
33
|
+
.coverage
|
|
34
|
+
htmlcov/
|
|
35
|
+
|
|
36
|
+
# OS
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-entsoe
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for the ENTSO-E Transparency Platform API
|
|
5
|
+
Project-URL: Repository, https://github.com/jsulopzs/python-entsoe
|
|
6
|
+
Author-email: jsulopzs <jesus.lopez@datons.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Keywords: api,electricity,energy,entsoe,transparency
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Requires-Python: >=3.13
|
|
16
|
+
Requires-Dist: pandas>=2.0
|
|
17
|
+
Requires-Dist: requests>=2.28
|
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# ENTSO-E Data Availability — Known Issues & Gotchas
|
|
2
|
+
|
|
3
|
+
Lessons learned while building and testing the `python-entsoe` library against the ENTSO-E Transparency Platform API.
|
|
4
|
+
|
|
5
|
+
## 1. ZIP-compressed responses
|
|
6
|
+
|
|
7
|
+
**Affected endpoints:** `imbalance_prices` (A85), `imbalance_volumes` (A86), unavailability queries
|
|
8
|
+
|
|
9
|
+
**Problem:** These endpoints return ZIP archives instead of raw XML. The response starts with `PK` (ZIP magic bytes) and parsing it as XML fails with:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
ParseError: not well-formed (invalid token): line 1, column 2
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Solution:** Detect ZIP responses by checking the first two bytes (`b"PK"`), extract the XML file(s) inside using `zipfile`, then parse normally. A single ZIP may contain multiple XML files.
|
|
16
|
+
|
|
17
|
+
## 2. Germany bidding zone (`DE` vs `DE_LU`)
|
|
18
|
+
|
|
19
|
+
**Affected endpoints:** `prices.day_ahead`, `balancing.imbalance_prices`, `transmission.net_transfer_capacity`
|
|
20
|
+
|
|
21
|
+
**Problem:** The country code `DE` maps to area `10Y1001A1001A83F` (Germany TSO area), but many data items are published under the `DE_LU` bidding zone (`10Y1001A1001A82H`). Using `DE` returns:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
NoDataError: No matching data found for Data item ENERGY_PRICES [12.1.D]
|
|
25
|
+
(10Y1001A1001A83F, 10Y1001A1001A83F) and interval .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Solution:** Use `DE_LU` (Germany/Luxembourg bidding zone) for:
|
|
29
|
+
- Day-ahead prices
|
|
30
|
+
- Cross-border flows and scheduled exchanges
|
|
31
|
+
- Net transfer capacity
|
|
32
|
+
|
|
33
|
+
Use `DE` only for load and generation data.
|
|
34
|
+
|
|
35
|
+
## 3. Imbalance prices — not available for all countries
|
|
36
|
+
|
|
37
|
+
**Affected endpoint:** `balancing.imbalance_prices` (A85)
|
|
38
|
+
|
|
39
|
+
**Problem:** `DE_LU` has no imbalance price data:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
NoDataError: No matching data found for Data item IMBALANCE_PRICES_R3 [17.1.G]
|
|
43
|
+
(10Y1001A1001A82H) and interval .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Confirmed working countries:** FR, BE, NL, ES
|
|
47
|
+
|
|
48
|
+
## 4. Net Transfer Capacity — route-specific availability
|
|
49
|
+
|
|
50
|
+
**Affected endpoint:** `transmission.net_transfer_capacity` (A61)
|
|
51
|
+
|
|
52
|
+
**Problem:** NTC data is not available for all country pairs. FR→DE_LU returns:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
NoDataError: No matching data found for Data item
|
|
56
|
+
FORECASTED_TRANSFER_CAPACITIES_EXPLICIT [11.1]
|
|
57
|
+
(10Y1001A1001A82H, 10YFR-RTE------C) and interval .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Confirmed working routes:** FR→ES, FR→GB, FR→IT_NORTH
|
|
61
|
+
|
|
62
|
+
## 5. Imbalance price value tag differs from other endpoints
|
|
63
|
+
|
|
64
|
+
**Affected endpoint:** `balancing.imbalance_prices` (A85)
|
|
65
|
+
|
|
66
|
+
**Problem:** Most endpoints use `<quantity>` or `<price.amount>` inside `<Point>` elements. Imbalance prices use a different tag:
|
|
67
|
+
|
|
68
|
+
```xml
|
|
69
|
+
<Point>
|
|
70
|
+
<position>1</position>
|
|
71
|
+
<imbalance_Price.amount>53.37</imbalance_Price.amount>
|
|
72
|
+
<imbalance_Price.category>A04</imbalance_Price.category>
|
|
73
|
+
</Point>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Parsing with only `quantity` and `price.amount` returns `None` values for all rows.
|
|
77
|
+
|
|
78
|
+
**Solution:** The XML parser must check for `imbalance_Price.amount` in addition to `quantity` and `price.amount`.
|
|
79
|
+
|
|
80
|
+
## 6. API key not inherited by Jupyter kernels
|
|
81
|
+
|
|
82
|
+
**Problem:** When executing notebooks programmatically with `jupyter nbconvert --execute`, the spawned kernel process does not inherit `.env` file variables. All notebooks fail with:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
ValueError: API key required. Pass api_key= or set the ENTSOE_API_KEY
|
|
86
|
+
environment variable.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Solution:** Export the env vars before running nbconvert:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export $(cat .env | xargs) && uv run jupyter nbconvert --execute ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Summary table
|
|
96
|
+
|
|
97
|
+
| Issue | Endpoint | Symptom | Fix |
|
|
98
|
+
|-------|----------|---------|-----|
|
|
99
|
+
| ZIP responses | imbalance_prices, imbalance_volumes | `ParseError` on XML parse | Detect `PK` magic bytes, unzip first |
|
|
100
|
+
| DE vs DE_LU | prices, balancing, transmission | `NoDataError` | Use `DE_LU` for market/price data |
|
|
101
|
+
| Country availability | imbalance_prices | `NoDataError` for DE_LU | Use FR, BE, NL, ES instead |
|
|
102
|
+
| Route availability | net_transfer_capacity | `NoDataError` for FR→DE_LU | Use FR→ES, FR→GB, FR→IT_NORTH |
|
|
103
|
+
| Value tag name | imbalance_prices | All values are `None` | Parse `imbalance_Price.amount` tag |
|
|
104
|
+
| Env vars in notebooks | all (via nbconvert) | `ValueError: API key required` | Export env vars before execution |
|