Skip to main content

Async client library for the Switch2 energy portal

Project description

python-switch2

Async Python client library for the Switch2 energy portal.

Installation

pip install switch2

Usage

import asyncio
from switch2 import Switch2ApiClient

async def main():
    client = Switch2ApiClient("you@example.com", "your-password")
    try:
        data = await client.fetch_data()
        print(f"Customer: {data.customer.name}")
        for reading in data.readings:
            print(f"  {reading.date}: {reading.amount} {reading.unit}")
        for bill in data.bills:
            print(f"  {bill.date}: £{bill.amount}")
    finally:
        await client.close()

asyncio.run(main())

License

Apache-2.0

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

switch2-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

switch2-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file switch2-0.1.1.tar.gz.

File metadata

  • Download URL: switch2-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for switch2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c64e4b226f7e9e822746f24e253494cc4d8a628e02668d1ac8385da8ac3697b3
MD5 56e7c775f5eab755c58f0d4ccda6a8e1
BLAKE2b-256 982596b6f6f713c14c6c1b5bc4c63f4adfce7ad8ec4a05a8a69a254eab248d12

See more details on using hashes here.

File details

Details for the file switch2-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: switch2-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for switch2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e729001bf1a874c7c829c76396716dbf1281ccdc2c3ea561676b039945019ef7
MD5 7ed2ed22baf0c75370f4bcbaffc48561
BLAKE2b-256 e7a449833e1b371e212ada8792d858e1d526fc0975d9badb62b458e140cf9041

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