elexonpy

Python package wrapper around Elexon api

https://github.com/openclimatefix/elexonpy

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary

Keywords from Contributors

nowcasting eumetsat gan nowcasting-models nowcasting-precipitation pytorch-implementation pytorch-lightning degoogle
Last synced: 6 months ago · JSON representation

Repository

Python package wrapper around Elexon api

Basic Info
  • Host: GitHub
  • Owner: openclimatefix
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1010 KB
Statistics
  • Stars: 20
  • Watchers: 3
  • Forks: 7
  • Open Issues: 10
  • Releases: 29
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Security

README.md

elexonpy

All Contributors <!-- ALL-CONTRIBUTORS-BADGE:END -->

tags badge pypi badge ease of contribution: easy

elexonpy is a Python package that provides a convenient interface to the ELEXON API.

This package is generated using Swagger Codegen, ensuring compatibility and ease of use with the ELEXON API services.

Installation

You can install the elexonpy package via pip from PyPI.

shell pip install elexonpy

Examples usage

There are some examples in the examples directory that demonstrate how to use the package to retrieve data from the Elexon API.

Example 1: Demand

This example demonstrates how to use methods from the DemandApi to retrieve various types of demand data from the Elexon API and format it into a DataFrame.

```python

This script demonstrates the use of methods from the DemandApi

to retrieve various types of demand data from the Elexon API.

from datetime import datetime import pandas as pd from elexonpy.apiclient import ApiClient from elexonpy.api.demandapi import DemandApi

Initialize API client

apiclient = ApiClient() demandapi = DemandApi(api_client)

Define date range for Actual Total Load Data

fromdate = datetime(2024, 7, 1) todate = datetime(2024, 7, 2)

Fetch Actual Total Load Data from API

df = demandapi.demandactualtotalget( from=fromdate, to=todate, settlementperiodfrom=1, settlementperiod_to=48, format='dataframe' )

Print Actual Total Load Data DataFrame

print("\n--- Actual Total Load Data ---") print(df.head()) ```

Example 2: SIP price

This example demonstrates how to use methods from the IndicativeImbalanceSettlementApi to retrieve settlement system prices data from the Elexon API and format it into a DataFrame.

Example 2 ```python # This script demonstrates the use of methods from the IndicativeImbalanceSettlementApi # to retrieve settlement system prices data from the Elexon API. from datetime import datetime import pandas as pd from elexonpy.api_client import ApiClient from elexonpy.api.indicative_imbalance_settlement_api import IndicativeImbalanceSettlementApi ## Initialize API client api_client = ApiClient() imbalance_settlement_api = IndicativeImbalanceSettlementApi(api_client) # Define settlement date settlement_date = '2024-07-02' # Fetch system prices data from API df = imbalance_settlement_api.balancing_settlement_system_prices_settlement_date_get( settlement_date=settlement_date, format='dataframe' ) # Print DataFrame print("\n--- Settlement System Prices Data ---") print(df.head()) ```

Example 3 : DA Solar and Wind Forecast

This example demonstrates how to use methods from the GenerationForecastApi to retrieve day-ahead forecast data for wind and solar generation from the Elexon API and format it into a DataFrame.

Example 3 ```python # This script demonstrates the use of methods from the GenerationForecastApi # to retrieve day-ahead forecast data for wind and solar generation from the Elexon API. from datetime import datetime import pandas as pd from elexonpy.api_client import ApiClient from elexonpy.api.generation_forecast_api import GenerationForecastApi # Initialize API client api_client = ApiClient() forecast_api = GenerationForecastApi(api_client) # Define date range for fetching day-ahead wind and solar forecast data from_date = datetime(2024, 7, 1) to_date = datetime(2024, 7, 7) # Note: Maximum data output range is 7 days # Fetch day-ahead forecast data for wind and solar from API df = forecast_api.forecast_generation_wind_and_solar_day_ahead_get( _from=from_date, to=to_date, process_type='day ahead', format='dataframe' ) # Print DataFrame print("\n--- Day-Ahead Wind and Solar Forecast Data ---") print(df.head()) ```

Documentation

API Endpoints

Documentation for the API Endpoints can be found here

Models

Documentation for the Models can be found here

Authorization

All endpoints do not require authorization.

FAQ

How do I get an API key?

You dont need one. The Elexon API does not require an API key for access.

How do I get a year worth of data?

You currently have to write a loop yourself. We hope to incorporate this into the package in the future.

Development

To install the package directly from the GitHub repository, use the following command:

shell pip install git+https://github.com/openclimatefix/Elexonpy.git

Tests

To run the tests, make sure you have pytest installed bash pip install pytest and then you can run bash pytest

Contributing and community

issues badge

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Richa
Richa

💻
Peter Dudfield
Peter Dudfield

👀
Matthew Duffin
Matthew Duffin

🤔
Jacqueline James
Jacqueline James

💻
Yousef Elsawy
Yousef Elsawy

📖
Utkarsh Verma
Utkarsh Verma

🚧
Anas Khan
Anas Khan

🚧

This project follows the all-contributors specification. Contributions of any kind welcome!

Part of the Open Climate Fix community.

OCF Logo

Owner

  • Name: Open Climate Fix
  • Login: openclimatefix
  • Kind: organization
  • Email: info@openclimatefix.org
  • Location: London

Using open science to mitigate climate change

GitHub Events

Total
  • Create event: 2
  • Issues event: 2
  • Release event: 2
  • Watch event: 9
  • Delete event: 1
  • Issue comment event: 34
  • Push event: 5
  • Pull request review event: 25
  • Pull request review comment event: 22
  • Pull request event: 6
  • Fork event: 4
Last Year
  • Create event: 2
  • Issues event: 2
  • Release event: 2
  • Watch event: 9
  • Delete event: 1
  • Issue comment event: 34
  • Push event: 5
  • Pull request review event: 25
  • Pull request review comment event: 22
  • Pull request event: 6
  • Fork event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 152
  • Total Committers: 9
  • Avg Commits per committer: 16.889
  • Development Distribution Score (DDS): 0.592
Past Year
  • Commits: 152
  • Committers: 9
  • Avg Commits per committer: 16.889
  • Development Distribution Score (DDS): 0.592
Top Committers
Name Email Commits
14Richa o****9@g****m 62
peterdudfield p****d@h****m 29
BumpVersion Action b****n@g****s 29
allcontributors[bot] 4****] 14
Jacqueline James 1****J 11
yousefsawy 9****y 4
Utkarsh Verma 1****a 1
Anas Khan a****8@g****m 1
Vijaya Bhaskar v****i@g****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 23
  • Total pull requests: 38
  • Average time to close issues: 20 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 4
  • Total pull request authors: 9
  • Average comments per issue: 2.17
  • Average comments per pull request: 1.16
  • Merged pull requests: 29
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 4
  • Pull requests: 12
  • Average time to close issues: 3 days
  • Average time to close pull requests: 5 days
  • Issue authors: 1
  • Pull request authors: 6
  • Average comments per issue: 2.75
  • Average comments per pull request: 1.67
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • peterdudfield (17)
  • 14Richa (2)
  • braddf (1)
  • mduffin95 (1)
Pull Request Authors
  • 14Richa (21)
  • peterdudfield (14)
  • allcontributors[bot] (14)
  • yousefsawy (4)
  • vijayabhaskar78 (4)
  • mduffin95 (2)
  • anxkhn (2)
  • Jacqueline-J (1)
  • lambaaryan011 (1)
  • Sigma-Verma (1)
Top Labels
Issue Labels
good first issue (7) enhancement (3) discussion (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,236 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 27
  • Total maintainers: 1
pypi.org: elexonpy

Elexon Python Client

  • Versions: 27
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,236 Last month
Rankings
Dependent packages count: 10.7%
Average: 35.3%
Dependent repos count: 60.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/pytest.yaml actions
pyproject.toml pypi
  • pandas *
  • requests <2.32.0
  • requests-mock *
.github/workflows/release.yaml actions