Skip to main content

Wrapper around the Ecotricity API

Project description

Ecotricity Client

This python library is intended to be used against the Ecotricity API used on the customer portal for fetching meter readings.

Example usage:

from ecotricity.client.requests import AgreementsRequest, ReadsRequest, AccountsRequest

from ecotricity.client.service import open_session

user = "yourUser"
password = "yourPassword"

session = open_session(user, password)

accounts_req = AccountsRequest()
accounts_res = accounts_req.get_accounts(session)
for account in accounts_res.data.results:
    agreements_req = AgreementsRequest()
    agreements_res = agreements_req.get_agreements(session, account.id,)
    for agreement in agreements_res.data.results:
        for product in agreement.products:
            for meter_point in product.meter_points:
                fuel_type = meter_point.fuel_type
                meter_id = meter_point.industry_id
                meter_reads_req = ReadsRequest()
                meter_reads_res = meter_reads_req.get_reads(session, meter_point.industry_id)
                for readings in meter_reads_res.data.results:
                    for reading in readings:
                        register_id = reading.register_industry_id
                        print(f'{fuel_type} - {meter_id} - {register_id} - {reading.date} - {reading.value}')

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

ecotricity-client-1.0.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecotricity_client-1.0.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file ecotricity-client-1.0.1.tar.gz.

File metadata

  • Download URL: ecotricity-client-1.0.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for ecotricity-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 53e00ff304fbc0d97de7d86086e26c23522f588ac7563383c19210a728096a51
MD5 21cd0070f1f345b9bd7d7d7d24cced25
BLAKE2b-256 2972acd3a9399d814798b42ff466f3cd086188bd74208155d7c95e1aec471bb3

See more details on using hashes here.

File details

Details for the file ecotricity_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ecotricity_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8d02d992676c17e6bcea1205b6cb87d996484503dd63478508debdb2cdd4d2c
MD5 43ae259f00267e0fe65e6142a91b70ef
BLAKE2b-256 e6e6988a1cfd5c5f37d43d8180e84c1c4b32499bbc38f6969903e9e090654dbd

See more details on using hashes here.

Supported by

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