{"id":20200855,"url":"https://github.com/openclimatefix/elexonpy","last_synced_at":"2025-04-10T11:21:41.281Z","repository":{"id":240084580,"uuid":"801632019","full_name":"openclimatefix/Elexonpy","owner":"openclimatefix","description":"Python package wrapper around Elexon api","archived":false,"fork":false,"pushed_at":"2025-01-26T20:43:03.000Z","size":1030,"stargazers_count":18,"open_issues_count":10,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T10:07:00.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openclimatefix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["openclimatefix"],"patreon":null,"open_collective":"openclimatefix","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-05-16T15:54:08.000Z","updated_at":"2025-02-14T14:52:36.000Z","dependencies_parsed_at":"2024-11-08T16:20:08.383Z","dependency_job_id":"2d2ac0fb-1c26-4e13-b933-ee7b6d180635","html_url":"https://github.com/openclimatefix/Elexonpy","commit_stats":null,"previous_names":["openclimatefix/pyelexon","openclimatefix/elexonpy"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2FElexonpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2FElexonpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2FElexonpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2FElexonpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openclimatefix","download_url":"https://codeload.github.com/openclimatefix/Elexonpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208603,"owners_count":21065203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:45:52.377Z","updated_at":"2025-04-10T11:21:41.239Z","avatar_url":"https://github.com/openclimatefix.png","language":"Python","funding_links":["https://github.com/sponsors/openclimatefix","https://opencollective.com/openclimatefix"],"categories":[],"sub_categories":[],"readme":"# elexonpy\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\n[![tags badge](https://img.shields.io/github/v/tag/openclimatefix/elexonpy?include_prereleases\u0026sort=semver\u0026color=FFAC5F)](https://github.com/openclimatefix/ocf-template/tags)\n[![pypi badge](https://img.shields.io/pypi/v/elexonpy?\u0026color=07BCDF)](https://pypi.org/project/elexonpy)\n[![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix#how-easy-is-it-to-get-involved) \n\n**elexonpy** is a Python package that provides a convenient interface to the [ELEXON API](https://developer.data.elexon.co.uk/).\n\nThis package is generated using Swagger Codegen, ensuring compatibility and ease of use with the ELEXON API services.\n\n\n## Installation\n\nYou can install the `elexonpy` package via pip from PyPI.\n\n```shell\npip install elexonpy\n```\n\n## Examples usage\n\nThere are some examples in the `examples` directory that demonstrate how to use the package to retrieve data from the Elexon API.\n\n### Example 1: Demand\n\nThis example demonstrates how to use methods from the `DemandApi` to retrieve various types of \ndemand data from the Elexon API and format it into a DataFrame.\n\n\n```python\n# This script demonstrates the use of methods from the DemandApi\n# to retrieve various types of demand data from the Elexon API.\n\nfrom datetime import datetime\nimport pandas as pd\nfrom elexonpy.api_client import ApiClient\nfrom elexonpy.api.demand_api import DemandApi\n\n# Initialize API client\napi_client = ApiClient()\ndemand_api = DemandApi(api_client)\n\n# Define date range for Actual Total Load Data\nfrom_date = datetime(2024, 7, 1)\nto_date = datetime(2024, 7, 2)\n\n# Fetch Actual Total Load Data from API\ndf = demand_api.demand_actual_total_get(\n    _from=from_date,\n    to=to_date,\n    settlement_period_from=1,\n    settlement_period_to=48,\n    format='dataframe'\n)\n\n# Print Actual Total Load Data DataFrame\nprint(\"\\n--- Actual Total Load Data ---\")\nprint(df.head())\n```\n\n### Example 2: SIP price\n\nThis example demonstrates how to use methods from the `IndicativeImbalanceSettlementApi` \nto retrieve settlement system prices data from the Elexon API and format it into a DataFrame.\n\n\n\u003cdetails\u003e\u003csummary\u003e Example 2 \u003c/summary\u003e\n\n```python\n# This script demonstrates the use of methods from the IndicativeImbalanceSettlementApi\n# to retrieve settlement system prices data from the Elexon API.\n\n\nfrom datetime import datetime\nimport pandas as pd\nfrom elexonpy.api_client import ApiClient\nfrom elexonpy.api.indicative_imbalance_settlement_api import IndicativeImbalanceSettlementApi\n\n## Initialize API client\napi_client = ApiClient()\nimbalance_settlement_api = IndicativeImbalanceSettlementApi(api_client)\n\n# Define settlement date\nsettlement_date = '2024-07-02'\n\n# Fetch system prices data from API\ndf = imbalance_settlement_api.balancing_settlement_system_prices_settlement_date_get(\n    settlement_date=settlement_date,\n    format='dataframe'\n)\n\n# Print DataFrame\nprint(\"\\n--- Settlement System Prices Data ---\")\nprint(df.head())\n```\n\n\u003c/details\u003e\n\n\n\n### Example 3 : DA Solar and Wind Forecast\n\nThis example demonstrates how to use methods from the `GenerationForecastApi` to retrieve \nday-ahead forecast data for wind and solar generation from the Elexon API and format it into a DataFrame.\n\n\u003cdetails\u003e\u003csummary\u003e Example 3 \u003c/summary\u003e\n\n```python\n# This script demonstrates the use of methods from the GenerationForecastApi\n# to retrieve day-ahead forecast data for wind and solar generation from the Elexon API.\n\nfrom datetime import datetime\nimport pandas as pd\nfrom elexonpy.api_client import ApiClient\nfrom elexonpy.api.generation_forecast_api import GenerationForecastApi\n\n# Initialize API client\napi_client = ApiClient()\nforecast_api = GenerationForecastApi(api_client)\n\n# Define date range for fetching day-ahead wind and solar forecast data\nfrom_date = datetime(2024, 7, 1)\nto_date = datetime(2024, 7, 7)  # Note: Maximum data output range is 7 days\n\n# Fetch day-ahead forecast data for wind and solar from API\ndf = forecast_api.forecast_generation_wind_and_solar_day_ahead_get(\n    _from=from_date,\n    to=to_date,\n    process_type='day ahead',\n    format='dataframe'\n)\n\n# Print DataFrame\nprint(\"\\n--- Day-Ahead Wind and Solar Forecast Data ---\")\nprint(df.head())\n```\n\n\u003c/details\u003e\n\n\n## Documentation \n\n### API Endpoints\n\nDocumentation for the API Endpoints can be found [here](./docs/DocApiEndpointsList.md)\n\n### Models\nDocumentation for the Models can be found [here](./docs/DocModelsList.md)\n\n### Authorization\n\n All endpoints do not require authorization.\n\n\n##  FAQ\n\n### How do I get an API key?\n\nYou dont need one. The Elexon API does not require an API key for access.\n\n### How do I get a year worth of data?\n\nYou currently have to write a loop yourself. We hope to incorporate this into the package in the future.\n\n## Development\n\nTo install the package directly from the GitHub repository, use the following command:\n\n```shell\n pip install git+https://github.com/openclimatefix/Elexonpy.git\n```\n\n### Tests\n\nTo run the tests, make sure you have `pytest` installed\n```bash\npip install pytest\n```\nand then you can run\n```bash\npytest\n```\n\n## Contributing and community\n\n[![issues badge](https://img.shields.io/github/issues/openclimatefix/elexonpy?color=FFAC5F)](https://github.com/openclimatefix/elexonpy/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)\n\n- PR's are welcome! See the [Organisation Profile](https://github.com/openclimatefix) for details on contributing\n- Find out about our other projects in the [OCF Meta Repo](https://github.com/openclimatefix/ocf-meta-repo)\n- Check out the [OCF blog](https://openclimatefix.org/blog) for updates\n- Follow OCF on [LinkedIn](https://uk.linkedin.com/company/open-climate-fix)\n\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://richasharma.co.in/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/41283476?v=4?s=100\" width=\"100px;\" alt=\"Richa\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRicha\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/openclimatefix/Elexonpy/commits?author=14Richa\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/peterdudfield\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/34686298?v=4?s=100\" width=\"100px;\" alt=\"Peter Dudfield\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePeter Dudfield\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/openclimatefix/Elexonpy/pulls?q=is%3Apr+reviewed-by%3Apeterdudfield\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/mduffin95\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6598483?v=4?s=100\" width=\"100px;\" alt=\"Matthew Duffin\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMatthew Duffin\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-mduffin95\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Jacqueline-J\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/108654780?v=4?s=100\" width=\"100px;\" alt=\"Jacqueline James\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJacqueline James\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/openclimatefix/Elexonpy/commits?author=Jacqueline-J\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/yousefsawy\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/99139949?v=4?s=100\" width=\"100px;\" alt=\"Yousef Elsawy\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eYousef Elsawy\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/openclimatefix/Elexonpy/commits?author=yousefsawy\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Sigma-Verma\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/131307209?v=4?s=100\" width=\"100px;\" alt=\"Utkarsh Verma\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eUtkarsh Verma\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-Sigma-Verma\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://anaskhan.me\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/83116240?v=4?s=100\" width=\"100px;\" alt=\"Anas Khan\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAnas Khan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-anxkhn\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n\n*Part of the [Open Climate Fix](https://github.com/orgs/openclimatefix/people) community.*\n\n[![OCF Logo](https://cdn.prod.website-files.com/62d92550f6774db58d441cca/6324a2038936ecda71599a8b_OCF_Logo_black_trans.png)](https://openclimatefix.org)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Felexonpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclimatefix%2Felexonpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Felexonpy/lists"}