Python Client for Elia Open Data
Project description
Elia OpenData Python Client
A Python client for accessing the Elia Open Data Portal API. This client provides a simple interface to access Elia's energy data with support for easy data conversion to popular data science formats.
Installation
pip install elia_opendata
Usage
Basic Usage
from elia_opendata import EliaClient, Dataset, DatasetCategory
# Initialize client
client = EliaClient()
# List all available datasets
catalog = client.get_catalog()
for entry in catalog:
print(f"Dataset: {entry.title} (ID: {entry.id})")
# Get dataset metadata using enum
solar_metadata = client.get_dataset(Dataset.PV_PRODUCTION)
# print(f"Solar data fields: {solar_metadata.fields}")
# Get records from a dataset
solar_data = client.get_records(Dataset.PV_PRODUCTION, limit=100)
print(solar_data)
print("First 5 solar records:")
for record in getattr(solar_data, 'records', [])[:5]:
print(record)
# Convert to different formats
df = solar_data.to_pandas() # Convert to pandas DataFrame
np_array = solar_data.to_numpy() # Convert to numpy array
pl_df = solar_data.to_polars() # Convert to polars DataFrame
arrow_table = solar_data.to_arrow() # Convert to Arrow table
Exploring Available Datasets
from elia_opendata import DatasetCategory
# Get all generation-related datasets
generation_datasets = Dataset.by_category(DatasetCategory.GENERATION)
for dataset in generation_datasets:
print(f"Generation dataset: {dataset.value}")
# Available categories
print("Available categories:")
for category in DatasetCategory:
print(f"- {category.value}")
Handling Large Datasets
# Iterate through large datasets in batches
for batch in client.iter_records(Dataset.ACTUAL_TOTAL_LOAD, batch_size=1000):
df = batch.to_pandas()
# Process your batch
Dataset Categories
The client provides enums for easy access to different types of data:
- Consumption Data: Total load, day-ahead and week-ahead forecasts
- Generation Data: Solar and wind generation, offshore/onshore forecasts
- Transmission Data: Cross-border flows, scheduled exchanges
- Balancing Data: Imbalance prices, system imbalance
- Congestion Management: Redispatch measures, costs
- Capacity Data: Transmission and installed capacity
- Bidding Zone Data: Prices and cross-border capacity
API Endpoints
The client maps directly to Elia's API endpoints:
get_catalog(): List all available datasets (GET /api/v2/catalog/datasets)get_dataset(): Get dataset metadata (GET /api/v2/catalog/datasets/{dataset_id})get_records(): Get dataset records (GET /api/v2/catalog/datasets/{dataset_id}/records)search_catalog(): Search datasets (GET /api/v2/catalog/datasets/search)
Dependencies
Core dependencies:
- requests
Optional dependencies for data conversion:
- pandas
- numpy
- polars
- pyarrow
License
MIT License
Project details
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 elia_opendata-0.1.0.tar.gz.
File metadata
- Download URL: elia_opendata-0.1.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be075bc3c6d3fee6e229e5053496e9448d8346357ec66d8b5fdaf6c2ba87476e
|
|
| MD5 |
b827c0a3ac4f02ff92e0328d4c8a6d0c
|
|
| BLAKE2b-256 |
c988d4efa056ee03545b37a038413a140a25fc66d151685231e8f380239b2da9
|
File details
Details for the file elia_opendata-0.1.0-py3-none-any.whl.
File metadata
- Download URL: elia_opendata-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4f8f793b82e86e5f76b56f8286a65b226ddf559d4bd3e65c53f65541d1ed4ef
|
|
| MD5 |
838ef92f6b567e50ab44793754a2423d
|
|
| BLAKE2b-256 |
07f4dbb7495d5cf2a6ceb19f6e30c5c282de891b24d3ca28dbca07b98fd3e008
|