Python library to fetch electricity market data from OMIE
Project description
omie-data
Python library to fetch electricity market data from OMIE (Operador del Mercado Ibérico de Energía).
Installation
pip install omie-market-data
Or install from source:
git clone https://github.com/yourusername/omie-data.git
cd omie-data
pip install -e .
Usage
from datetime import datetime
from omie_data import get_omie_data, get_omie_url
# Fetch data for a specific date
date = datetime(2025, 10, 1)
df = get_omie_data(date)
if df is not None:
print(df.head())
# Columns: start_period, end_period, plus one column per metric (prices, power, etc.)
else:
print("Data not available for this date")
# Get the URL used for a date (useful for debugging)
url = get_omie_url(date)
print(url)
Data format
The returned DataFrame is period-based (one row per 15-minute interval):
| Column | Description |
|---|---|
start_period |
Start of the 15-min interval (datetime) |
end_period |
End of the 15-min interval (datetime) |
| metric columns | One column per metric (e.g. marginal price Spanish/Portuguese, total power buy/sell, etc.) |
- 96 rows per day (24 hours × 4 quarters).
- Intervals follow OMIE quarters: H1Q1 = 00:00–00:15, H1Q2 = 00:15–00:30, …, H24Q4 = 23:45–24:00.
API
-
get_omie_data(date: datetime) -> Optional[pd.DataFrame]
Fetches data for the given date. ReturnsNoneif the file is not available (e.g. 404). -
get_omie_url(date: datetime) -> str
Returns the OMIE URL used for that date (for debugging or manual download).
Examples
See test_omie_data.ipynb for a full Jupyter notebook with:
- Fetching and exploring the period-based DataFrame
- Plotting prices and other metrics
- Converting to hourly averages
- Exporting to CSV/Excel
Requirements
- Python 3.7+
- pandas
For maintainers: publishing to PyPI
See PUBLISHING.md for step-by-step instructions to publish the package to PyPI so anyone can run pip install omie-market-data.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omie_market_data-0.1.0.tar.gz.
File metadata
- Download URL: omie_market_data-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
456e2876fbc33dda85ae0124225ca0ddef46884fee5c2319e10fbb316e943e6c
|
|
| MD5 |
e979cccd3fc31245d4bcfdff95bd5f01
|
|
| BLAKE2b-256 |
15f86e86250f1fa8e6aecb743dc0e8214ffa64e619ea9987d7dbb0b231c43da7
|
File details
Details for the file omie_market_data-0.1.0-py3-none-any.whl.
File metadata
- Download URL: omie_market_data-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7298365e18b3bbcf61d1292e513d0d2a6c85a48f38c8d4bee74d7ca2e76644fb
|
|
| MD5 |
ed1d4fb5a2bc0f3de2fe88fd59045253
|
|
| BLAKE2b-256 |
debf685613fafe225ec28d066c1729463d8ec5b697ed3a3a591d6a8cd1e955b8
|