Skip to main content

bmrs-json-api

PyPI version Downloads Python 3.6+ Code style: black

For returning BMRS API data in json format, it fetches data and auto converts it to a dictionary object, easier for data processing.

Dependecies

  1. stomp.py
  2. xmltodict

Installation

Use the package manager pip to install bmrs-json-api.

pip install bmrs

Example Usage

'''This could be your example consumer file from which you will receive and process the API responses'''
from bmrs import connect_to_api


def on_message(json_response):
    '''Receive a JSON response and do stuff with it'''
    print(list(json_response.keys()))
    # print(json_response)


# If client_id is not specified, the computer hostname is automatically picked
# but that means only one connection per computer (name)
bmrs.connect_to_api(
    api_key = 'YOUR API KEY HERE',
    client_id = 'YOUR_CLIENT_ID_HERE',
    listener=on_message # mention the name of your main data receiving function as a parameter
)     

Known bugs

Dealing with disconnects doesn't recyle threads

Getting API key

  • Register on the ELEXON Portal.
  • The API Key is the Scripting Key under Basics on your profile.

Imposter syndrome disclaimer: We want your help. No, really.

There may be a little voice inside your head that is telling you that you're not ready to be an open source contributor; that your skills aren't nearly good enough to contribute. What could you possibly offer a project like this one?

We assure you - the little voice in your head is wrong. If you can write code at all, you can contribute code to open source. Contributing to open source projects is a fantastic way to advance one's coding skills. Writing perfect code isn't the measure of a good developer (that would disqualify all of us!); it's trying to create something, making mistakes, and learning from those mistakes. That's how we all improve, and we are happy to help others learn.

Being an open source contributor doesn't just mean writing code, either. You can help out by writing documentation, tests, or even giving feedback about the project (and yes - that includes giving feedback about the contribution process). Some of these contributions may be the most valuable to the project as a whole, because you're coming to the project with fresh eyes, so you can see the errors and assumptions that seasoned contributors have glossed over.

Contributing

For major changes, please open an issue first to discuss what you would like to contribute. Please make sure to update tests as appropriate. Also, add your name to the readme in the Contributors section (below).

Contributors and acknowledgment

  1. Edison Abahurire simicode - BDFL
  2. Elijah Rwothoromo rwothoromo - For big updates to documentation
  3. Martin Ahindura Tinitto - For adding the durable connection method

License

MIT

Packaged with: Flit

Release files for bmrs 2021.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bmrs 2021.7.4
File Size Uploaded
bmrs-2021.7.4.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bmrs 2021.7.4
File Interpreter ABI Platform
bmrs-2021.7.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / bmrs-2021.7.4.tar.gz

Download URL bmrs-2021.7.4.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7be638dab75bc7cc033c93fad2c4f513e87fed25b61af2bcabb4b1fa7bfba1e4
BLAKE2b-256 checksum
How to use checksums
d96f0ab5f87ca20fcb118e79ccdde55deac357114d6db18a7a0ceeca926829b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / bmrs-2021.7.4-py3-none-any.whl

Download URL bmrs-2021.7.4-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1531baff2870e5dc3f79d544fd85d74c374618d557b505956931068ce91bb52
BLAKE2b-256 checksum
How to use checksums
63cb9fdd5dd00a766e3b6699db231d6c86dccb513eb0503c96134d8be9061e43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release history Release notifications | RSS feed

This release

2021.7.4 This release

2 release files

1.2.84

2 release files

1.2.83

2 release files

1.2.71

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

2 release files

1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page