michaelkavanagh / elexon Goto Github PK
View Code? Open in Web Editor NEWA simple python wrapper for the Elexon BMRS API.
Home Page: https://pypi.org/project/elexon/
License: MIT License
A simple python wrapper for the Elexon BMRS API.
Home Page: https://pypi.org/project/elexon/
License: MIT License
Hi @michaelkavanagh !
I get a TypeError: missing parameter NGCBMUnitID
when trying to call the B1610 API without this parameter specified. However, according to the official documentation this is not a required parameter.
Off topic:
Nice work on the wrapper! I'm trying to find a library to download Elexon data and came across your repo. I tried pywind before, but it's heavily outdated. Out of curiosity: Do you know about elexon api tool? I wonder what are the differences between your package and theirs.
Cheers!
Ben
Hi @michaelkavanagh,
it's me again. 😅 Just tried elexon v0.1.1 B1610 API with v2
parameter as you suggested in #2. There seems to be a problem with the internal result parser because the period
field remains empty.
My code:
from elexon import ElexonRawClient
api = ElexonRawClient(apikey, 'v2')
generation = api.Transparency.B1610(SettlementDate = '2020-01-01', Period = '*')
generation
is an array with entries like this:
{'documentType': 'Actual generation',
'businessType': 'Production',
'processType': 'Realised',
'timeSeriesID': 'ELX-EMFIP-AGOG-TS-18481',
'curveType': 'Sequential fixed size block',
'settlementDate': datetime.datetime(2020, 1, 1, 0, 0),
'powerSystemResourceType': 'Generation',
'registeredResourceEICCode': '48W000000DAMC-1M',
'marketGenerationUnitEICCode': '48W000000DAMC-1M',
'marketGenerationBMUId': 'T_DAMC-1',
'marketGenerationNGCBMUId': 'DAMC-1',
'bMUnitID': 'T_DAMC-1',
'nGCBMUnitID': 'DAMC-1',
'activeFlag': True,
'documentID': 'ELX-EMFIP-AGOG-22495386',
'documentRevNum': 1,
'Period': None}
Unfortunately, the Period
field is empty for all array elements. When I do the API call via browser, I see that Period
looks like this:
<Period>
<timeInterval>
<start>2020-01-01</start>
<end>2020-01-01</end>
</timeInterval>
<resolution>PT30M</resolution>
<Point>
<settlementPeriod>48</settlementPeriod>
<quantity>280.8</quantity>
</Point>
<Point>
<settlementPeriod>47</settlementPeriod>
<quantity>154.44</quantity>
</Point>
<Point>
<settlementPeriod>46</settlementPeriod>
<quantity>71.28</quantity>
</Point>
</Period>
Which makes me assume that the Period
xml is not parsed properly by elexon?
Keep up the great work 😉
Ben
Hi @michaelkavanagh,
this is more of a data issue but maybe you know a solution: Is there a complete list of onshore wind units and their IDs somewhere? When downloading B1610 data, the PSR Type column says “Generation” for all entries and does not differentiate between wind / solar / gas / coal... When looking at B1420 data, I see several “Wind Onshore” units but the list is incomplete. Some units (e.g. BRYBW-1 and CRGHW-1) are classified again as “Generation”. A complete listing of onshore wind units would be very helpful. Do you know if it is available in any of the APIs?
Cheers
Ben
Although, it is possible to isntlal the package it is not usable anymore. The module can be found via pip freeze but raises a ModuleNotFoundError when trying to install. The previous version 0.2.0 still works.
(test_env) C:\Users\user\test>pip install elexon
Looking in indexes: https://pypi.python.org/simple/,
Collecting elexon
Downloading elexon-0.2.2-py3-none-any.whl (3.0 kB)
Installing collected packages: elexon
Successfully installed elexon-0.2.2
WARNING: You are using pip version 20.1.1; however, version 21.2.4 is available.
You should consider upgrading via the 'c:\users\user\test\test_env\scripts\python.exe -m pip install --upgrade pip' command.
(test_env) C:\Users\user\test>python
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import elexon
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'elexon'
(test_env) C:\Users\user\test>pip freeze
elexon==0.2.2
Use Elexon BMRS Data Push Service
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.