python-esios 2.1.0__tar.gz → 2.3.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 (88) hide show
  1. python_esios-2.3.0/.release-please-manifest.json +3 -0
  2. {python_esios-2.1.0 → python_esios-2.3.0}/CHANGELOG.md +24 -0
  3. {python_esios-2.1.0 → python_esios-2.3.0}/CLAUDE.md +1 -1
  4. {python_esios-2.1.0 → python_esios-2.3.0}/PKG-INFO +2 -1
  5. {python_esios-2.1.0 → python_esios-2.3.0}/pyproject.toml +2 -1
  6. python_esios-2.3.0/src/esios/.agents/skills/esios/SKILL.md +182 -0
  7. python_esios-2.3.0/src/esios/catalog.py +478 -0
  8. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/app.py +2 -0
  9. python_esios-2.3.0/src/esios/cli/catalog_cmd.py +177 -0
  10. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/client.py +5 -0
  11. python_esios-2.3.0/src/esios/data/archives.yaml +921 -0
  12. python_esios-2.3.0/src/esios/data/geos.yaml +3 -0
  13. python_esios-2.3.0/src/esios/data/indicators.yaml +43 -0
  14. python_esios-2.3.0/src/esios/data/magnitudes.yaml +3 -0
  15. python_esios-2.3.0/src/esios/data/time_periods.yaml +3 -0
  16. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/managers/archives.py +2 -4
  17. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/managers/indicators.py +25 -4
  18. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/processing/i90.py +32 -11
  19. python_esios-2.1.0/.release-please-manifest.json +0 -3
  20. python_esios-2.1.0/src/esios/.agents/skills/esios/SKILL.md +0 -207
  21. python_esios-2.1.0/src/esios/data/catalogs/archives/__init__.py +0 -5
  22. python_esios-2.1.0/src/esios/data/catalogs/archives/catalog.py +0 -163
  23. python_esios-2.1.0/src/esios/data/catalogs/archives/refresh.py +0 -95
  24. python_esios-2.1.0/tests/__init__.py +0 -0
  25. {python_esios-2.1.0 → python_esios-2.3.0}/.github/workflows/release-please.yml +0 -0
  26. {python_esios-2.1.0 → python_esios-2.3.0}/.gitignore +0 -0
  27. {python_esios-2.1.0 → python_esios-2.3.0}/LICENSE +0 -0
  28. {python_esios-2.1.0 → python_esios-2.3.0}/README.md +0 -0
  29. {python_esios-2.1.0 → python_esios-2.3.0}/examples/.gitignore +0 -0
  30. {python_esios-2.1.0 → python_esios-2.3.0}/examples/01_Quickstart/01_Setup and First Query.ipynb +0 -0
  31. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/01_Search Indicators.ipynb +0 -0
  32. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/02_Historical Data.ipynb +0 -0
  33. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/03_Multi-Geography Indicators.ipynb +0 -0
  34. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/04_Compare Indicators.ipynb +0 -0
  35. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/05_Market Prices.ipynb +0 -0
  36. {python_esios-2.1.0 → python_esios-2.3.0}/examples/02_Indicators/06_Generation and Demand.ipynb +0 -0
  37. {python_esios-2.1.0 → python_esios-2.3.0}/examples/03_Archives/01_Download Archives.ipynb +0 -0
  38. {python_esios-2.1.0 → python_esios-2.3.0}/examples/03_Archives/02_I90 Settlement Files.ipynb +0 -0
  39. {python_esios-2.1.0 → python_esios-2.3.0}/examples/04_Caching/01_Cache Management.ipynb +0 -0
  40. {python_esios-2.1.0 → python_esios-2.3.0}/examples/05_Advanced/01_Ad-hoc Pandas Expressions.ipynb +0 -0
  41. {python_esios-2.1.0 → python_esios-2.3.0}/examples/05_Advanced/02_Async Client.ipynb +0 -0
  42. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/01_Quickstart/01_Setup and First Query.yaml +0 -0
  43. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/01_Search Indicators.yaml +0 -0
  44. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/02_Historical Data.yaml +0 -0
  45. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/03_Multi-Geography Indicators.yaml +0 -0
  46. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/04_Compare Indicators.yaml +0 -0
  47. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/05_Market Prices.yaml +0 -0
  48. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/02_Indicators/06_Generation and Demand.yaml +0 -0
  49. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/03_Archives/01_Download Archives.yaml +0 -0
  50. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/03_Archives/02_I90 Settlement Files.yaml +0 -0
  51. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/04_Caching/01_Cache Management.yaml +0 -0
  52. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/05_Advanced/01_Ad-hoc Pandas Expressions.yaml +0 -0
  53. {python_esios-2.1.0 → python_esios-2.3.0}/examples/_specs/05_Advanced/02_Async Client.yaml +0 -0
  54. {python_esios-2.1.0 → python_esios-2.3.0}/examples/generate.py +0 -0
  55. {python_esios-2.1.0 → python_esios-2.3.0}/release-please-config.json +0 -0
  56. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/__init__.py +0 -0
  57. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/async_client.py +0 -0
  58. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cache.py +0 -0
  59. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/__init__.py +0 -0
  60. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/archives.py +0 -0
  61. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/cache_cmd.py +0 -0
  62. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/config.py +0 -0
  63. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/config_cmd.py +0 -0
  64. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/exec_cmd.py +0 -0
  65. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/cli/indicators.py +0 -0
  66. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/constants.py +0 -0
  67. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/data/__init__.py +0 -0
  68. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/exceptions.py +0 -0
  69. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/managers/__init__.py +0 -0
  70. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/managers/base.py +0 -0
  71. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/managers/offer_indicators.py +0 -0
  72. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/models/__init__.py +0 -0
  73. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/models/archive.py +0 -0
  74. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/models/indicator.py +0 -0
  75. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/models/offer_indicator.py +0 -0
  76. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/processing/__init__.py +0 -0
  77. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/processing/dataframes.py +0 -0
  78. {python_esios-2.1.0 → python_esios-2.3.0}/src/esios/processing/zip.py +0 -0
  79. {python_esios-2.1.0/src/esios/data/catalogs → python_esios-2.3.0/tests}/__init__.py +0 -0
  80. {python_esios-2.1.0 → python_esios-2.3.0}/tests/conftest.py +0 -0
  81. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_cache.py +0 -0
  82. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_client.py +0 -0
  83. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_dataframes.py +0 -0
  84. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_exceptions.py +0 -0
  85. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_i90.py +0 -0
  86. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_managers.py +0 -0
  87. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_models.py +0 -0
  88. {python_esios-2.1.0 → python_esios-2.3.0}/tests/test_zip.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.3.0"
3
+ }
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.0](https://github.com/datons/python-esios/compare/python-esios-v2.2.0...python-esios-v2.3.0) (2026-03-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * restore column_name parameter in historical() ([a967b6f](https://github.com/datons/python-esios/commit/a967b6f54cd4e84d18469d99f0d4e03665b73e81))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handle DST transitions in I90 datetime parsing ([aa1deef](https://github.com/datons/python-esios/commit/aa1deefd442f2c53a376a4f3773b6fffea562121))
14
+
15
+ ## [2.2.0](https://github.com/datons/python-esios/compare/python-esios-v2.1.0...python-esios-v2.2.0) (2026-03-04)
16
+
17
+
18
+ ### Features
19
+
20
+ * add YAML-backed catalog with enriched indicator metadata ([00cc4b6](https://github.com/datons/python-esios/commit/00cc4b69a66268d6d4d6e63ce7d4d8f91c7e813a))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * update skill with catalog commands and Python-first approach ([6051fb3](https://github.com/datons/python-esios/commit/6051fb31cbea2dce0b5eaeb87a561c33d8d8d4e6))
26
+
3
27
  ## [2.1.0](https://github.com/datons/python-esios/compare/python-esios-v2.0.2...python-esios-v2.1.0) (2026-03-04)
4
28
 
5
29
 
@@ -12,7 +12,7 @@ This project uses [release-please](https://github.com/googleapis/release-please)
12
12
 
13
13
  **Key files:**
14
14
 
15
- - `.release-please-config.json` — release-please configuration (package type, changelog sections)
15
+ - `release-please-config.json` — release-please configuration (package type, changelog sections)
16
16
  - `.release-please-manifest.json` — tracks current version
17
17
  - `.github/workflows/release-please.yml` — workflow (release PR management + PyPI publish)
18
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-esios
3
- Version: 2.1.0
3
+ Version: 2.3.0
4
4
  Summary: A Python wrapper for the ESIOS API (Spanish electricity market)
5
5
  Project-URL: Homepage, https://github.com/datons/python-esios
6
6
  Project-URL: Repository, https://github.com/datons/python-esios
@@ -27,6 +27,7 @@ Requires-Dist: pandas>=2.0
27
27
  Requires-Dist: pyarrow>=15.0
28
28
  Requires-Dist: pydantic>=2.0
29
29
  Requires-Dist: python-calamine>=0.2
30
+ Requires-Dist: pyyaml>=6.0
30
31
  Requires-Dist: rich>=13.0
31
32
  Requires-Dist: tenacity>=8.0
32
33
  Requires-Dist: typer>=0.12
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-esios"
7
- version = "2.1.0"
7
+ version = "2.3.0"
8
8
  description = "A Python wrapper for the ESIOS API (Spanish electricity market)"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0-only"
@@ -35,6 +35,7 @@ dependencies = [
35
35
  "beautifulsoup4>=4.12",
36
36
  "typer>=0.12",
37
37
  "rich>=13.0",
38
+ "pyyaml>=6.0",
38
39
  ]
39
40
 
40
41
  [project.scripts]
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: esios
3
+ description: Query Spanish electricity market data (ESIOS/REE). Use when the user asks about electricity prices, generation, demand, I90 files, or any ESIOS indicator.
4
+ version: 3.0.0
5
+ ---
6
+
7
+ # ESIOS Data Assistant
8
+
9
+ You have access to the `python-esios` library and CLI for querying the Spanish electricity market (ESIOS/REE).
10
+
11
+ ## When to use what
12
+
13
+ - **Python scripts** (default): reproducible, composable, saveable. Use for any data work the user will want to keep or iterate on.
14
+ - **CLI**: quick one-shot lookups, exploration, sanity checks. Use when the user wants a fast answer they won't need again.
15
+ - **If unsure**: ask the user whether they want a script or a quick CLI check.
16
+
17
+ ## Python Library (default)
18
+
19
+ ```python
20
+ from esios import ESIOSClient
21
+
22
+ client = ESIOSClient() # reads config file, then ESIOS_API_KEY env var
23
+
24
+ # --- Indicators ---
25
+
26
+ # Get indicator handle
27
+ handle = client.indicators.get(600)
28
+
29
+ # Historical data as DataFrame
30
+ df = handle.historical("2025-01-01", "2025-01-31")
31
+
32
+ # Filter by geography
33
+ df = handle.historical("2025-01-01", "2025-01-31", geo_ids=[3]) # España only
34
+
35
+ # Inspect geographies
36
+ handle.geos # List of {"geo_id": int, "geo_name": str}
37
+ handle.geos_dataframe() # DataFrame with geo_id and geo_name columns
38
+ handle.resolve_geo("España") # Returns 3
39
+
40
+ # Search indicators
41
+ results = client.indicators.search("precio")
42
+
43
+ # Compare multiple indicators
44
+ df = client.indicators.compare([600, 10034, 10035], "2025-01-01", "2025-01-07")
45
+
46
+ # --- I90 Settlement Files ---
47
+
48
+ from esios.processing.i90 import I90Book
49
+
50
+ archive = client.archives.get(34)
51
+ books = I90Book.from_archive(archive, start="2025-05-05", end="2025-06-08")
52
+
53
+ book = books[0]
54
+ sheet = book["I90DIA03"]
55
+ df = sheet.df # Preprocessed DataFrame with datetime index
56
+ print(sheet.frequency) # "hourly" or "hourly-quarterly"
57
+ ```
58
+
59
+ ### Common Indicator IDs
60
+
61
+ | ID | Name | Description | Geos |
62
+ |----|------|-------------|------|
63
+ | 600 | Precio mercado spot | OMIE spot market price | ES, PT, FR, DE, BE, NL |
64
+ | 1001 | Precio mercado diario | Day-ahead market price | ES |
65
+ | 10033 | Demanda real | Real-time electricity demand | ES |
66
+ | 10034 | Generación eólica | Real-time wind generation | ES |
67
+ | 10035 | Generación solar FV | Real-time solar PV generation | ES |
68
+ | 1293 | Demanda prevista | Forecasted demand | ES |
69
+
70
+ Use `client.indicators.search("query")` to find more.
71
+
72
+ ### Multi-Geo Indicators
73
+
74
+ Some indicators (e.g. 600) return data for multiple countries. Output is pivoted so each geography becomes a column:
75
+
76
+ ```
77
+ datetime España Portugal Francia Alemania Bélgica Países Bajos
78
+ 2025-01-01 00:00:00 63.50 63.50 72.10 58.20 58.20 58.20
79
+ ```
80
+
81
+ ### Geography Reference
82
+
83
+ | geo_id | geo_name |
84
+ |--------|----------|
85
+ | 1 | Portugal |
86
+ | 2 | Francia |
87
+ | 3 | España |
88
+ | 8826 | Alemania |
89
+ | 8827 | Bélgica |
90
+ | 8828 | Países Bajos |
91
+
92
+ ### I90 Key Sheets
93
+
94
+ | Sheet | Description |
95
+ |-------|-------------|
96
+ | I90DIA03 | Restricciones en el Mercado Diario (curtailment) |
97
+ | I90DIA08 | Restricciones en Tiempo Real |
98
+ | I90DIA26 | Programa Base de Funcionamiento (PBF, generation program) |
99
+ | I90DIA01 | Programa PVP |
100
+ | I90DIA07 | Regulación Terciaria (mFRR) |
101
+
102
+ ### Key conventions
103
+
104
+ - All timestamps are in Europe/Madrid timezone
105
+ - Date ranges > 3 weeks are auto-chunked into smaller API requests
106
+ - Data older than 48h is considered final (won't be re-fetched)
107
+ - Recent data (last 48h) is re-fetched on each request (electricity market corrections)
108
+ - Cache is per-column sparse: fetching `geo_ids=[3]` only caches that column
109
+ - Custom exceptions: `ESIOSError`, `AuthenticationError`, `APIResponseError`, `NetworkError`
110
+
111
+ ## CLI Reference (quick lookups)
112
+
113
+ ### Catalog (offline)
114
+
115
+ ```bash
116
+ esios catalog list indicators # List cataloged indicators
117
+ esios catalog list indicators "precio" # Filter by name
118
+ esios catalog list archives # List cataloged archives
119
+ esios catalog show indicator 600 # Details for indicator
120
+ esios catalog show archive 34 # Details for archive
121
+ esios catalog refresh # Refresh from live API
122
+ esios catalog refresh --dry-run # Preview changes
123
+ ```
124
+
125
+ ### Indicators
126
+
127
+ ```bash
128
+ esios indicators list # List all indicators
129
+ esios indicators search "precio" # Search by name
130
+ esios indicators meta 600 # Show metadata
131
+ esios indicators history 600 -s 2025-01-01 -e 2025-01-31
132
+ esios indicators history 600 -s 2025-01-01 -e 2025-01-31 --geo España
133
+ esios indicators history 600 -s 2025-01-01 -e 2025-01-31 --format csv --output data.csv
134
+ ```
135
+
136
+ ### Archives
137
+
138
+ ```bash
139
+ esios archives list # List available archives
140
+ esios archives download 34 -s 2025-05-01 -e 2025-05-31 --output ./data
141
+ esios archives sheets 34 --date 2025-06-01 # List sheets in I90 file
142
+ ```
143
+
144
+ ### Exec (ad-hoc pandas)
145
+
146
+ ```bash
147
+ # Indicators
148
+ esios indicators exec 600 -s 2025-01-01 -e 2025-01-31 -x "df.describe()"
149
+ esios indicators exec 600 -s 2025-01-01 -e 2025-01-31 --geo España -x "df.resample('D').mean()"
150
+ esios indicators exec 600 10034 -s 2025-01-01 -e 2025-01-31 -x "df.corr()"
151
+
152
+ # Archives (I90)
153
+ esios archives exec 34 --sheet I90DIA03 --date 2025-06-01 -x "df.groupby('Sentido')['value'].sum()"
154
+ esios archives exec 34 --sheet I90DIA03 -s 2025-05-05 -e 2025-06-08 \
155
+ -x "df[df['Sentido']=='Bajar'].groupby('Unidad de Programación')['value'].sum().sort_values()"
156
+ ```
157
+
158
+ ### Cache management
159
+
160
+ ```bash
161
+ esios cache status # Path, size, registry info
162
+ esios cache geos # Global geo_id → geo_name registry
163
+ esios cache clear # Clear indicator cache
164
+ esios cache clear --all # Clear everything
165
+ esios cache clear --indicator 600 # Clear one indicator
166
+ ```
167
+
168
+ ### Output options
169
+
170
+ ```
171
+ --format table|csv|json|parquet (default: table)
172
+ --output file.csv (write to file instead of stdout)
173
+ ```
174
+
175
+ ## Configuration
176
+
177
+ ```bash
178
+ esios config set token <API_KEY>
179
+ esios config show
180
+ ```
181
+
182
+ Config file: `~/.config/esios/config.toml`. API key resolution: config file > `ESIOS_API_KEY` env var.