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](http://www.energybrokers.co.uk/electricity/PES-Distributor-areas.htm) for a postcode

client.get_region_id_for_postcode(postcode='se14yu')

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.2.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

ENSEK-0.2.1-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for ENSEK-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7e39423c78d1f322beff05c10b522d8531fa36d90adaf7618f671170c9fe78a3
MD5 c70734a49a981adf9fe9caa9ace5760c
BLAKE2b-256 92c2afdd8f9ae3c2e5dffb6267dd3613ea8b00397cc0463084adfa9202bd12a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ENSEK-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dba096c343c15db4f630d54648732c14b06f3bfaf5f8fb4e49c660f16c1769f5
MD5 4deedf9cb381e0db2931ac36547f01b1
BLAKE2b-256 3e7bc9f8eb48450c1a2b55a2d407a1e65f5605b962525ca3b4d820f023112761

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