Skip to main content

Python Client for Elia Open Data

Project description

PyPI Build Status

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

elia_opendata-0.1.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elia_opendata-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file elia_opendata-0.1.1.tar.gz.

File metadata

  • Download URL: elia_opendata-0.1.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for elia_opendata-0.1.1.tar.gz
Algorithm Hash digest
SHA256 29c18b5de2f884a6e866aa30d3f0fff3d8f5e6c8e6914df69824191a234c60df
MD5 be70a7e39e5571fc69027972bdaeef41
BLAKE2b-256 14fd80f10b9f0361d5fbfe36b07f45427939fe5109916ba419671a77b5bb1856

See more details on using hashes here.

File details

Details for the file elia_opendata-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: elia_opendata-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for elia_opendata-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd487afa2edd1b8dbb9c63411af187c8a2da507ef92879f4245b82dd1568203
MD5 51944d4460a63e6c0e2fc83555619b0d
BLAKE2b-256 d89e1bf322ae97b7d71bc8a6387fdca92a942e5ecb485807609268bfda8b8c72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page