python-esios 0.2.6__tar.gz → 2.0.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_esios-2.0.0/.claude-plugin/marketplace.json +15 -0
- python_esios-2.0.0/.claude-plugin/plugin.json +12 -0
- python_esios-2.0.0/.github/workflows/publish.yml +26 -0
- python_esios-2.0.0/.gitignore +47 -0
- python_esios-2.0.0/CHANGELOG.md +47 -0
- python_esios-2.0.0/PKG-INFO +103 -0
- python_esios-2.0.0/README.md +75 -0
- python_esios-2.0.0/examples/.gitignore +5 -0
- python_esios-2.0.0/examples/01_Quickstart/01_Setup and First Query.ipynb +557 -0
- python_esios-2.0.0/examples/02_Indicators/01_Search Indicators.ipynb +646 -0
- python_esios-2.0.0/examples/02_Indicators/02_Historical Data.ipynb +597 -0
- python_esios-2.0.0/examples/02_Indicators/03_Multi-Geography Indicators.ipynb +689 -0
- python_esios-2.0.0/examples/02_Indicators/04_Compare Indicators.ipynb +735 -0
- python_esios-2.0.0/examples/02_Indicators/05_Market Prices.ipynb +542 -0
- python_esios-2.0.0/examples/02_Indicators/06_Generation and Demand.ipynb +631 -0
- python_esios-2.0.0/examples/03_Archives/01_Download Archives.ipynb +405 -0
- python_esios-2.0.0/examples/03_Archives/02_I90 Settlement Files.ipynb +361 -0
- python_esios-2.0.0/examples/04_Caching/01_Cache Management.ipynb +256 -0
- python_esios-2.0.0/examples/05_Advanced/01_Ad-hoc Pandas Expressions.ipynb +838 -0
- python_esios-2.0.0/examples/05_Advanced/02_Async Client.ipynb +177 -0
- python_esios-2.0.0/examples/_specs/01_Quickstart/01_Setup and First Query.yaml +48 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/01_Search Indicators.yaml +38 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/02_Historical Data.yaml +48 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/03_Multi-Geography Indicators.yaml +47 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/04_Compare Indicators.yaml +47 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/05_Market Prices.yaml +55 -0
- python_esios-2.0.0/examples/_specs/02_Indicators/06_Generation and Demand.yaml +52 -0
- python_esios-2.0.0/examples/_specs/03_Archives/01_Download Archives.yaml +41 -0
- python_esios-2.0.0/examples/_specs/03_Archives/02_I90 Settlement Files.yaml +50 -0
- python_esios-2.0.0/examples/_specs/04_Caching/01_Cache Management.yaml +62 -0
- python_esios-2.0.0/examples/_specs/05_Advanced/01_Ad-hoc Pandas Expressions.yaml +45 -0
- python_esios-2.0.0/examples/_specs/05_Advanced/02_Async Client.yaml +65 -0
- python_esios-2.0.0/examples/generate.py +47 -0
- python_esios-2.0.0/pyproject.toml +48 -0
- python_esios-2.0.0/skills/esios/SKILL.md +162 -0
- python_esios-2.0.0/src/esios/__init__.py +21 -0
- python_esios-2.0.0/src/esios/async_client.py +121 -0
- python_esios-2.0.0/src/esios/cache.py +532 -0
- python_esios-2.0.0/src/esios/cli/__init__.py +10 -0
- python_esios-2.0.0/src/esios/cli/app.py +49 -0
- python_esios-2.0.0/src/esios/cli/archives.py +66 -0
- python_esios-2.0.0/src/esios/cli/cache_cmd.py +103 -0
- python_esios-2.0.0/src/esios/cli/config.py +63 -0
- python_esios-2.0.0/src/esios/cli/config_cmd.py +34 -0
- python_esios-2.0.0/src/esios/cli/exec_cmd.py +127 -0
- python_esios-2.0.0/src/esios/cli/indicators.py +192 -0
- python_esios-2.0.0/src/esios/client.py +181 -0
- python_esios-2.0.0/src/esios/constants.py +20 -0
- python_esios-2.0.0/src/esios/exceptions.py +28 -0
- python_esios-2.0.0/src/esios/managers/__init__.py +9 -0
- python_esios-2.0.0/src/esios/managers/archives.py +236 -0
- python_esios-2.0.0/src/esios/managers/base.py +31 -0
- python_esios-2.0.0/src/esios/managers/indicators.py +452 -0
- python_esios-2.0.0/src/esios/managers/offer_indicators.py +118 -0
- python_esios-2.0.0/src/esios/models/__init__.py +11 -0
- python_esios-2.0.0/src/esios/models/archive.py +41 -0
- python_esios-2.0.0/src/esios/models/indicator.py +44 -0
- python_esios-2.0.0/src/esios/models/offer_indicator.py +30 -0
- python_esios-2.0.0/src/esios/processing/__init__.py +11 -0
- python_esios-2.0.0/src/esios/processing/dataframes.py +80 -0
- python_esios-2.0.0/src/esios/processing/i90.py +218 -0
- python_esios-2.0.0/src/esios/processing/zip.py +53 -0
- python_esios-2.0.0/tests/__init__.py +0 -0
- python_esios-2.0.0/tests/conftest.py +93 -0
- python_esios-2.0.0/tests/test_cache.py +605 -0
- python_esios-2.0.0/tests/test_client.py +58 -0
- python_esios-2.0.0/tests/test_dataframes.py +92 -0
- python_esios-2.0.0/tests/test_exceptions.py +31 -0
- python_esios-2.0.0/tests/test_managers.py +256 -0
- python_esios-2.0.0/tests/test_models.py +60 -0
- python_esios-2.0.0/tests/test_zip.py +44 -0
- python_esios-0.2.6/PKG-INFO +0 -65
- python_esios-0.2.6/README.md +0 -49
- python_esios-0.2.6/esios/__init__.py +0 -3
- python_esios-0.2.6/esios/archives/__init__.py +0 -100
- python_esios-0.2.6/esios/archives/preprocessing.py +0 -32
- python_esios-0.2.6/esios/client.py +0 -57
- python_esios-0.2.6/esios/indicators.py +0 -99
- python_esios-0.2.6/esios/offer_indicators.py +0 -85
- python_esios-0.2.6/python_esios.egg-info/PKG-INFO +0 -65
- python_esios-0.2.6/python_esios.egg-info/SOURCES.txt +0 -14
- python_esios-0.2.6/python_esios.egg-info/dependency_links.txt +0 -1
- python_esios-0.2.6/python_esios.egg-info/requires.txt +0 -2
- python_esios-0.2.6/python_esios.egg-info/top_level.txt +0 -1
- python_esios-0.2.6/setup.cfg +0 -4
- python_esios-0.2.6/setup.py +0 -29
- {python_esios-0.2.6 → python_esios-2.0.0}/LICENSE +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "python-esios",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Datons AI",
|
|
5
|
+
"email": "jesus.lopez@datons.ai"
|
|
6
|
+
},
|
|
7
|
+
"plugins": [
|
|
8
|
+
{
|
|
9
|
+
"name": "esios",
|
|
10
|
+
"source": ".",
|
|
11
|
+
"description": "Query Spanish electricity market data (ESIOS/REE) — prices, generation, demand, I90 files, and any ESIOS indicator.",
|
|
12
|
+
"version": "2.0.0"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "esios",
|
|
3
|
+
"description": "Query Spanish electricity market data (ESIOS/REE) — prices, generation, demand, I90 files, and any ESIOS indicator.",
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Jesús López",
|
|
7
|
+
"email": "jesus.lopez@datons.ai"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/datons/python-esios",
|
|
10
|
+
"license": "GPL-3.0-only",
|
|
11
|
+
"keywords": ["esios", "ree", "electricity", "energy", "spain", "omie"]
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write # Required for trusted publishing
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
|
|
19
|
+
- name: Install build tools
|
|
20
|
+
run: pip install build
|
|
21
|
+
|
|
22
|
+
- name: Build package
|
|
23
|
+
run: python -m build
|
|
24
|
+
|
|
25
|
+
- name: Publish to PyPI
|
|
26
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.pyo
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
|
|
9
|
+
# uv
|
|
10
|
+
.venv/
|
|
11
|
+
uv.lock
|
|
12
|
+
|
|
13
|
+
# Environment
|
|
14
|
+
.env
|
|
15
|
+
.env.*
|
|
16
|
+
|
|
17
|
+
# OS
|
|
18
|
+
.DS_Store
|
|
19
|
+
Thumbs.db
|
|
20
|
+
|
|
21
|
+
# IDE
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
*.swp
|
|
25
|
+
*.swo
|
|
26
|
+
|
|
27
|
+
# Generated docs
|
|
28
|
+
docs/
|
|
29
|
+
|
|
30
|
+
# Data files (large / sensitive)
|
|
31
|
+
*.xls
|
|
32
|
+
*.xlsx
|
|
33
|
+
data/
|
|
34
|
+
|
|
35
|
+
# Legacy code (superseded by src/)
|
|
36
|
+
esios_legacy/
|
|
37
|
+
|
|
38
|
+
# Test / coverage
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
.coverage
|
|
41
|
+
htmlcov/
|
|
42
|
+
|
|
43
|
+
# Config with secrets
|
|
44
|
+
.config/
|
|
45
|
+
|
|
46
|
+
# Dev scripts
|
|
47
|
+
random/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.0.0] - 2026-02-27
|
|
4
|
+
|
|
5
|
+
Complete rewrite of the library with a new architecture, CLI, and caching system.
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- New package structure: `from esios import ESIOSClient` (was `from esios.client import Esios`)
|
|
10
|
+
- Indicators return wide-format DataFrames with geo names as columns (e.g., `"España"`)
|
|
11
|
+
- Archives API redesigned with `client.archives.download()`
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **CLI** (`esios`): full command-line interface with `indicators`, `archives`, `cache`, and `config` commands
|
|
16
|
+
- **Multi-geo support**: indicators with multiple geographies return one column per geo (e.g., España, Francia, Portugal)
|
|
17
|
+
- **`--geo` filter**: filter by geography ID or name in both CLI and Python API
|
|
18
|
+
- **Smart caching**: parquet-based cache with per-column gap detection and sparse column support
|
|
19
|
+
- Per-indicator directories (`{id}/data.parquet` + `{id}/meta.json`)
|
|
20
|
+
- Global geo registry (`geos.json`) learned incrementally from API responses
|
|
21
|
+
- Per-endpoint catalog (`catalog.json`) with 24h TTL
|
|
22
|
+
- Per-indicator metadata (`meta.json`) with 7-day TTL
|
|
23
|
+
- Auto-migration from v1 flat cache files
|
|
24
|
+
- **`esios exec`**: ad-hoc pandas expressions on indicator data
|
|
25
|
+
- **`esios indicators meta`**: inspect indicator metadata
|
|
26
|
+
- **`esios cache status`**: Rich panel showing cache health, geos registry, and catalog info
|
|
27
|
+
- **`esios cache geos`**: inspect the global geography registry
|
|
28
|
+
- **`esios config set token`**: store API token in `~/.config/esios/config.toml`
|
|
29
|
+
- **I90 processing**: `I90Book` class for parsing settlement files with automatic frequency detection
|
|
30
|
+
- **Async client**: `AsyncESIOSClient` for concurrent requests
|
|
31
|
+
- **Claude Code plugin**: installable skill with full domain knowledge (`/plugin marketplace add datons/python-esios`)
|
|
32
|
+
|
|
33
|
+
### Improved
|
|
34
|
+
|
|
35
|
+
- Automatic date-range chunking for large queries (>3 weeks)
|
|
36
|
+
- Atomic file writes (tempfile + rename) for cache safety
|
|
37
|
+
- TTL-based cache freshness: recent data (48h) re-fetched for electricity market corrections
|
|
38
|
+
- Geo enrichment: learns missing geo mappings from API values (e.g., indicator 600 omits Países Bajos/8828)
|
|
39
|
+
- Custom exceptions: `ESIOSError`, `AuthenticationError`, `APIResponseError`, `NetworkError`
|
|
40
|
+
|
|
41
|
+
## [0.1.0] - 2024-05-15
|
|
42
|
+
|
|
43
|
+
Initial release.
|
|
44
|
+
|
|
45
|
+
- Basic indicator data download
|
|
46
|
+
- Archive file download (I90, Liquicomun, CoefK)
|
|
47
|
+
- I90 preprocessing with sheet access
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-esios
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A Python wrapper for the ESIOS API (Spanish electricity market)
|
|
5
|
+
Project-URL: Homepage, https://github.com/datons/python-esios
|
|
6
|
+
Project-URL: Repository, https://github.com/datons/python-esios
|
|
7
|
+
Author-email: Jesús López <jesus.lopez@datons.ai>
|
|
8
|
+
License-Expression: GPL-3.0-only
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: beautifulsoup4>=4.12
|
|
19
|
+
Requires-Dist: httpx>=0.27
|
|
20
|
+
Requires-Dist: pandas>=2.0
|
|
21
|
+
Requires-Dist: pyarrow>=15.0
|
|
22
|
+
Requires-Dist: pydantic>=2.0
|
|
23
|
+
Requires-Dist: python-calamine>=0.2
|
|
24
|
+
Requires-Dist: rich>=13.0
|
|
25
|
+
Requires-Dist: tenacity>=8.0
|
|
26
|
+
Requires-Dist: typer>=0.12
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# python-esios
|
|
30
|
+
|
|
31
|
+
A Python library and CLI to query the Spanish electricity market API (ESIOS/REE).
|
|
32
|
+
|
|
33
|
+
Download indicators (prices, generation, demand), archives (I90 settlement files), and more.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
pip install python-esios
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Configure your token
|
|
42
|
+
|
|
43
|
+
Request a personal token from [REE](https://www.esios.ree.es/es/pagina/api), then:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
esios config set token YOUR_TOKEN
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This stores the token in `~/.config/esios/config.toml`. Alternatively, set the `ESIOS_API_KEY` environment variable.
|
|
50
|
+
|
|
51
|
+
## CLI usage
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
# Search indicators
|
|
55
|
+
esios indicators search "precio"
|
|
56
|
+
|
|
57
|
+
# Download historical data
|
|
58
|
+
esios indicators history 600 --start 2025-01-01 --end 2025-01-31
|
|
59
|
+
|
|
60
|
+
# Export to CSV
|
|
61
|
+
esios indicators history 600 -s 2025-01-01 -e 2025-01-31 --format csv --output prices.csv
|
|
62
|
+
|
|
63
|
+
# List archives
|
|
64
|
+
esios archives list
|
|
65
|
+
|
|
66
|
+
# Download I90 settlement files
|
|
67
|
+
esios archives download 1 --start 2025-01-01 --end 2025-01-31
|
|
68
|
+
|
|
69
|
+
# Cache status
|
|
70
|
+
esios cache status
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Python usage
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from esios import ESIOSClient
|
|
77
|
+
|
|
78
|
+
client = ESIOSClient()
|
|
79
|
+
|
|
80
|
+
# Get indicator data as DataFrame
|
|
81
|
+
handle = client.indicators.get(600) # PVPC price
|
|
82
|
+
df = handle.historical("2025-01-01", "2025-01-31")
|
|
83
|
+
|
|
84
|
+
# Search indicators
|
|
85
|
+
results = client.indicators.search("precio")
|
|
86
|
+
|
|
87
|
+
# Download archives
|
|
88
|
+
client.archives.download(1, start="2025-01-01", end="2025-01-31", output_dir="./data")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Common indicators
|
|
92
|
+
|
|
93
|
+
| ID | Name | Description |
|
|
94
|
+
|----|------|-------------|
|
|
95
|
+
| 600 | PVPC | Voluntary price for small consumers |
|
|
96
|
+
| 1001 | Day-ahead price | OMIE spot market price |
|
|
97
|
+
| 10033 | Demand | Real-time electricity demand |
|
|
98
|
+
| 10034 | Wind generation | Real-time wind generation |
|
|
99
|
+
| 10035 | Solar PV generation | Real-time solar generation |
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
GPL-3.0
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# python-esios
|
|
2
|
+
|
|
3
|
+
A Python library and CLI to query the Spanish electricity market API (ESIOS/REE).
|
|
4
|
+
|
|
5
|
+
Download indicators (prices, generation, demand), archives (I90 settlement files), and more.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
pip install python-esios
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configure your token
|
|
14
|
+
|
|
15
|
+
Request a personal token from [REE](https://www.esios.ree.es/es/pagina/api), then:
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
esios config set token YOUR_TOKEN
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This stores the token in `~/.config/esios/config.toml`. Alternatively, set the `ESIOS_API_KEY` environment variable.
|
|
22
|
+
|
|
23
|
+
## CLI usage
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
# Search indicators
|
|
27
|
+
esios indicators search "precio"
|
|
28
|
+
|
|
29
|
+
# Download historical data
|
|
30
|
+
esios indicators history 600 --start 2025-01-01 --end 2025-01-31
|
|
31
|
+
|
|
32
|
+
# Export to CSV
|
|
33
|
+
esios indicators history 600 -s 2025-01-01 -e 2025-01-31 --format csv --output prices.csv
|
|
34
|
+
|
|
35
|
+
# List archives
|
|
36
|
+
esios archives list
|
|
37
|
+
|
|
38
|
+
# Download I90 settlement files
|
|
39
|
+
esios archives download 1 --start 2025-01-01 --end 2025-01-31
|
|
40
|
+
|
|
41
|
+
# Cache status
|
|
42
|
+
esios cache status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Python usage
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from esios import ESIOSClient
|
|
49
|
+
|
|
50
|
+
client = ESIOSClient()
|
|
51
|
+
|
|
52
|
+
# Get indicator data as DataFrame
|
|
53
|
+
handle = client.indicators.get(600) # PVPC price
|
|
54
|
+
df = handle.historical("2025-01-01", "2025-01-31")
|
|
55
|
+
|
|
56
|
+
# Search indicators
|
|
57
|
+
results = client.indicators.search("precio")
|
|
58
|
+
|
|
59
|
+
# Download archives
|
|
60
|
+
client.archives.download(1, start="2025-01-01", end="2025-01-31", output_dir="./data")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Common indicators
|
|
64
|
+
|
|
65
|
+
| ID | Name | Description |
|
|
66
|
+
|----|------|-------------|
|
|
67
|
+
| 600 | PVPC | Voluntary price for small consumers |
|
|
68
|
+
| 1001 | Day-ahead price | OMIE spot market price |
|
|
69
|
+
| 10033 | Demand | Real-time electricity demand |
|
|
70
|
+
| 10034 | Wind generation | Real-time wind generation |
|
|
71
|
+
| 10035 | Solar PV generation | Real-time solar generation |
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
GPL-3.0
|