elexonpy
A Python package that provides a convenient interface to the ELEXON API suite, which provides data published by the UK energy data provider as received.
https://github.com/openclimatefix/elexonpy
Category: Energy Systems
Sub Category: Energy Data Accessibility and Integration
Keywords from Contributors
eumetsat nowcasting
Last synced: about 8 hours ago
JSON representation
Repository metadata
Python package wrapper around Elexon api
- Host: GitHub
- URL: https://github.com/openclimatefix/elexonpy
- Owner: openclimatefix
- License: mit
- Created: 2024-05-16T15:54:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-26T20:43:03.000Z (11 months ago)
- Last Synced: 2025-10-19T00:49:48.096Z (2 months ago)
- Language: Python
- Size: 1010 KB
- Stars: 21
- Watchers: 3
- Forks: 8
- Open Issues: 12
- Releases: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
README.md
elexonpy
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.
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.
# 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.api_client import ApiClient
from elexonpy.api.demand_api import DemandApi
# Initialize API client
api_client = ApiClient()
demand_api = DemandApi(api_client)
# Define date range for Actual Total Load Data
from_date = datetime(2024, 7, 1)
to_date = datetime(2024, 7, 2)
# Fetch Actual Total Load Data from API
df = demand_api.demand_actual_total_get(
_from=from_date,
to=to_date,
settlement_period_from=1,
settlement_period_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.
# 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.
# 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:
pip install git+https://github.com/openclimatefix/Elexonpy.git
Tests
To run the tests, make sure you have pytest installed
pip install pytest
and then you can run
pytest
Contributing and community
- PR's are welcome! See the Organisation Profile for details on contributing
- Find out about our other projects in the OCF Meta Repo
- Check out the OCF blog for updates
- Follow OCF on LinkedIn
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Part of the Open Climate Fix community.
Owner metadata
- Name: Open Climate Fix
- Login: openclimatefix
- Email: info@openclimatefix.org
- Kind: organization
- Description: Using open science to mitigate climate change
- Website: openclimatefix.org
- Location: London
- Twitter: openclimatefix
- Company:
- Icon url: https://avatars.githubusercontent.com/u/48357542?v=4
- Repositories: 88
- Last ynced at: 2024-04-15T07:32:15.529Z
- Profile URL: https://github.com/openclimatefix
GitHub Events
Total
- Create event: 2
- Issues event: 2
- Release event: 2
- Watch event: 10
- Delete event: 1
- Issue comment event: 34
- Push event: 5
- Pull request review event: 25
- Pull request review comment event: 22
- Pull request event: 9
- Fork event: 5
Last Year
- Create event: 2
- Issues event: 2
- Release event: 2
- Watch event: 8
- Delete event: 1
- Issue comment event: 34
- Push event: 5
- Pull request review event: 25
- Pull request review comment event: 22
- Pull request event: 9
- Fork event: 5
Committers metadata
Last synced: about 2 months ago
Total Commits: 152
Total Committers: 9
Avg Commits per committer: 16.889
Development Distribution Score (DDS): 0.592
Commits in past year: 6
Committers in past year: 3
Avg Commits per committer in past year: 2.0
Development Distribution Score (DDS) in past year: 0.5
| Name | 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 |
| Vijaya Bhaskar | v****i@g****m | 1 |
| Utkarsh Verma | 1****a | 1 |
| Anas Khan | a****8@g****m | 1 |
Issue and Pull Request metadata
Last synced: 3 months ago
Total issues: 22
Total pull requests: 65
Average time to close issues: 24 days
Average time to close pull requests: 4 days
Total issue authors: 5
Total pull request authors: 11
Average comments per issue: 1.86
Average comments per pull request: 0.8
Merged pull request: 51
Bot issues: 0
Bot pull requests: 14
Past year issues: 4
Past year pull requests: 14
Past year average time to close issues: N/A
Past year average time to close pull requests: 3 days
Past year issue authors: 2
Past year pull request authors: 7
Past year average comments per issue: 2.75
Past year average comments per pull request: 1.5
Past year merged pull request: 7
Past year bot issues: 0
Past year bot pull requests: 2
Top Issue Authors
- peterdudfield (17)
- 14Richa (2)
- ma1jmk (1)
- braddf (1)
- mduffin95 (1)
Top Pull Request Authors
- 14Richa (21)
- allcontributors[bot] (14)
- peterdudfield (14)
- yousefsawy (4)
- vijayabhaskar78 (4)
- mduffin95 (2)
- anxkhn (2)
- Jacqueline-J (1)
- lambaaryan011 (1)
- Sigma-Verma (1)
- ma1jmk (1)
Top Issue Labels
- good first issue (7)
- enhancement (3)
- discussion (1)
- bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 941 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 27
- Total maintainers: 1
pypi.org: elexonpy
Elexon Python Client
- Homepage: https://github.com/openclimatefix/Elexonpy
- Documentation: https://elexonpy.readthedocs.io/
- Licenses: MIT License
- Latest release: 1.0.16 (published 11 months ago)
- Last Synced: 2025-10-30T08:37:18.965Z (about 2 months ago)
- Versions: 27
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 941 Last month
-
Rankings:
- Dependent packages count: 10.656%
- Average: 35.334%
- Dependent repos count: 60.011%
- Maintainers (1)
Dependencies
- pandas *
- requests <2.32.0
- requests-mock *
Score: 12.541737413379064
