Skip to main content

Python Client for the ENSEK API (http://www.ensek.co.uk/)

Project description

PyPI Python Versions Build Status

🐍 Python Client for the ENSEK API (http://www.ensek.co.uk/) This client does not implement all the features of the API, pull requests are very welcome to expand functionality.

Installation

To install ensek, simply:

pip install ensek

How To Use

Initialise the client

from ensek import Ensek
client = Ensek(
    api_url='https://api.usio.ignition.ensek.co.uk/',
    api_key='fill_this_in',
)

Available methods

Get an account by id

client.get_account(account_id=123)

Get tariffs for an account by id

client.get_account_tariffs(account_id=123)

Get meter points for an account by id

client.get_meter_points(account_id=123)

Get recent newly registered accounts

client.get_completed_signups()

Get the account id currently associated with an MPAN core id

client.get_account_for_meter_point(mpan_core_id='9910000001507')

Get the PES Area for a postcode (http://www.energybrokers.co.uk/electricity/PES-Distributor-areas.htm)

client.get_region_id_for_postcode(postcode='se14yu')

Get gas utility information for a MPRN (meter point reference number)

client.get_gas_utility(mprn='3226987202')

Note: For each client method:

  • If API response is 404, method will raise LookupError.

  • If API response is between 400 and 499, method will raise ValueError.

  • For any other bad status code EnsekError will raise.

Requirements

1. Python 3.6+
2. See requirements.txt

Running the tests

pip install -r requirements-test.txt
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ENSEK-0.3.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

ENSEK-0.3.0-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ENSEK-0.3.0.tar.gz.

File metadata

  • Download URL: ENSEK-0.3.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ENSEK-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b977c9c8f15a118ae9bcf4f0c726112590a9c20ba2df5befa891b84734bf55f9
MD5 eafeba8c851fcee63726211baf8ae8fb
BLAKE2b-256 7aad9b3b1f1f8b670e8824b1107520a3946b89040a2bebd57f17232a36bdfba9

See more details on using hashes here.

File details

Details for the file ENSEK-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ENSEK-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d2fbf7e4a4372470cf402186b526a55d777873319a0229f815e9f0995e6b60d6
MD5 713a75a17e551d4a35a2ee0ad7a3ad30
BLAKE2b-256 c7432277e5b6574e12fe34b4c3b34111099e08528014e937bf549c21faf1582b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page