Skip to main content

A client library for accessing Enelyzer API

Project description

enelyzer-api-client

A client library for accessing Enelyzer API

Usage

First Authenticate and get your access token:

from enelyzer_api_client.auth import DeviceCodeAuthenticator, ServiceAccountAuthenticator

client_id = ""
client_secret = ""
username = ""
password = ""
environment = "production" # or "staging"

authenticator = ServiceAccountAuthenticator(client_id, client_secret, username, password, environment=environment)
token = authenticator.get_auth_token().access_token

Then, create a client:

from enelyzer_api_client import AuthenticatedClient

base_url_staging="https://client-api.enelyzer.com"
base_url_production="https://client-api.enelyzer.com"
client = AuthenticatedClient(base_url=base_url_staging, token="{token}")

Now call your endpoint and use your models:

from enelyzer_api_client.api.units_categories_and_quantities import get_units


organisation_group = ""
organisation_id = ""

with client as client:
     response = get_units.sync(
         organisation_group=organisation_group,
         organisation_id=organisation_id,
         client=client,
     )

    print(response)

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

enelyzer_api_client-0.4.5.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

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

enelyzer_api_client-0.4.5-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

Details for the file enelyzer_api_client-0.4.5.tar.gz.

File metadata

  • Download URL: enelyzer_api_client-0.4.5.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.11 Darwin/22.6.0

File hashes

Hashes for enelyzer_api_client-0.4.5.tar.gz
Algorithm Hash digest
SHA256 14c87bea4e625c7712c0cb2b1a69356e32d20a5fa258eaecd8bb162f4dd36f09
MD5 29b9f0929d400e6c1c13aecf58b2603b
BLAKE2b-256 516a9c9dd51954a48e35a3fa3349012a07c4ab85c2a64349b986114ed774d9e8

See more details on using hashes here.

File details

Details for the file enelyzer_api_client-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for enelyzer_api_client-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 99c264c97484f61990ddb2ab007df04ec7c4cc96adc987905029688b4f876c73
MD5 37bf439c7a2cea7a4740c717790d652e
BLAKE2b-256 544f7f2e06ef3c0015b84fc302a1c67dd3efd635f1b66b3d5c12fa5958386f70

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