openclimatefix / Elexonpy

Python package wrapper around Elexon api
MIT License
12 stars 4 forks source link

Generate client using OpenAPI spec? #17

Closed mduffin95 closed 3 months ago

mduffin95 commented 3 months ago

Have you considered using the OpenAPI spec to generate this wrapper? It should save a bit of time.

On this page you can download the spec:

https://bmrs.elexon.co.uk/api-documentation/guidance

You can then use a tool such as Swagger Codegen to generate the python client (FYI I had to delete leading and trailing square brackets in the spec).

I tried this out briefly tonight and ended up with this: https://github.com/mduffin95/py-elexon-poc.

It's possible to refine the output by customising the code generator (for example, the package name could be changed).

peterdudfield commented 3 months ago

Thanks @mduffin95 I was looking for something like this. It will definatly save time.

@14Richa would you be able to look at this? It might be easier to start with something like this https://github.com/mduffin95/py-elexon-poc which is generated automatically and then we add extra features too it, like returning as pandas dataframe.

peterdudfield commented 3 months ago

Thanks you @mduffin95, we used this, and it massively speed it up

mduffin95 commented 3 months ago

ah glad to hear!

peterdudfield commented 3 months ago

@all-contributors please add @mduffin95 for ideas

allcontributors[bot] commented 3 months ago

@peterdudfield

I've put up a pull request to add @mduffin95! :tada: