{"id":28975050,"url":"https://github.com/octoenergy/ensek","last_synced_at":"2025-06-24T12:08:16.646Z","repository":{"id":57426541,"uuid":"129413319","full_name":"octoenergy/ENSEK","owner":"octoenergy","description":"🐍 Python Client for the ENSEK API (http://www.ensek.co.uk/) ","archived":false,"fork":false,"pushed_at":"2018-10-01T09:01:43.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-30T00:25:37.004Z","etag":null,"topics":["api","api-client","api-wrapper","ensek","http","python-lib","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octoenergy.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-13T14:27:10.000Z","updated_at":"2023-07-25T14:16:25.000Z","dependencies_parsed_at":"2022-09-19T06:00:30.265Z","dependency_job_id":null,"html_url":"https://github.com/octoenergy/ENSEK","commit_stats":null,"previous_names":["usio-energy/ensek"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/octoenergy/ENSEK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoenergy%2FENSEK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoenergy%2FENSEK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoenergy%2FENSEK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoenergy%2FENSEK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octoenergy","download_url":"https://codeload.github.com/octoenergy/ENSEK/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoenergy%2FENSEK/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261669021,"owners_count":23192362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-wrapper","ensek","http","python-lib","python3"],"created_at":"2025-06-24T12:08:14.399Z","updated_at":"2025-06-24T12:08:16.620Z","avatar_url":"https://github.com/octoenergy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ENSEK\n=======\n\n|PyPI| |Python Versions| |Build Status|\n\n🐍 Python Client for the ENSEK API (http://www.ensek.co.uk/)\nThis client does not implement all the features of the API, pull requests are very welcome to expand functionality.\n\nInstallation\n------------\n\nTo install ensek, simply:\n\n.. code:: bash\n\n    pip install ensek\n\nHow To Use\n----------\n\nInitialise the client\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n    from ensek import Ensek\n    client = Ensek(\n        api_url='https://api.usio.ignition.ensek.co.uk/',\n        api_key='fill_this_in',\n    )\n\nAvailable methods\n~~~~~~~~~~~~~~~~~\n\n**Get an account by id**\n\n``client.get_account(account_id=123)``\n\n**Get account settings by id**\n\n``client.get_account_settings(account_id=123)``\n\n**Get account live balances**\n\n``client.get_live_balances(account_id=123)``\n\n``client.get_live_balances_detailed(account_id=123)``\n\n**Get tariffs for an account by id**\n\n``client.get_account_tariffs(account_id=123)``\n\n**Get meter points for an account by id**\n\n``client.get_meter_points(account_id=123)``\n\n**Get the account id currently associated with an MPAN core id or MPRN**\n\n``client.get_account_for_meter_point(meter_point_id='9910000001507')``\n\n**Get the PES Area for a postcode** (`\u003chttp://www.energybrokers.co.uk/electricity/PES-Distributor-areas.htm\u003e`_)\n\n``client.get_region_id_for_postcode(postcode='se14yu')``\n\n**Get gas utility information for a MPRN (meter point reference number)**\n\n``client.get_gas_utility(mprn='3226987202')``\n\n**Get electricity utility information for a MPAN CORE ID (meter point administration number)**\n\n``client.get_electricity_utility(mpan_core_id='3226987202')``\n\n**Create a meter reading**\n\n``client.create_meter_reading(account_id=1507, source='SMART', meter_point_id=1597, register_id=1496, value=2.0, timestamp=datetime(2018, 7, 24, 13, 49, 34, 661562, tzinfo=timezone.utc))``\n\n**Get readings for a meter point**\n\n``client.get_meter_point_readings(meter_point_id=1597)``\n\n**Get all customer account ids**\n\n``client.get_all_account_ids()``\n\n**Get addresses at a postcode**\n\n``client.get_addresses_at_postcode(postcode='se14yu')``\n\n**Get account attributes**\n\n```python\nclient.get_account_attributes(account_id=1597)\n```\n\n**Update account attribute**\n\n```python\nclient.update_account_attribute(\n    account_id=1597,\n    name='PaymentType',\n    value='some-value',\n    type='string',\n)\n```\n\nNote: For each client method:\n\n- If API response is 404, method will raise ``LookupError``.\n- If API response is between 400 and 499, method will raise ``ValueError``.\n- For any other bad status code ``EnsekError`` will raise.\n\n\nRequirements\n------------\n\n::\n\n    1. Python 3.6+\n    2. See requirements.txt\n\nRunning the tests\n-----------------\n\n.. code:: bash\n\n    pip install -r requirements-test.txt\n    pytest\n\nReleasing to PyPI\n-----------------\n\n.. code:: bash\n\n    pip install zest.releaser\n    fullrelease\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/ensek.svg\n   :target: https://pypi.python.org/pypi/ensek\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/ensek.svg\n   :target: https://pypi.python.org/pypi/ensek\n.. |Build Status| image:: https://travis-ci.org/Usio-Energy/ENSEK.png?branch=master\n   :target: https://travis-ci.org/Usio-Energy/ensek\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoenergy%2Fensek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoenergy%2Fensek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoenergy%2Fensek/lists"}