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.2.tar.gz (9.2 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.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: switch2-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 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.2.tar.gz
Algorithm Hash digest
SHA256 eb945ddeb41639f57d0ba86ea6296a7a1f9b3ae7522d4ffe8367c625bee07ac0
MD5 e38593b5266a9b2237cb2908de79819b
BLAKE2b-256 8182f03dd063b908fbc941d6611820b74687f312767a50626fa3c6543e074ec6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: switch2-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d839b795de169649d680f8e8e745fb4b5e6be038ca1e45c0c661ba92b1f3164a
MD5 353650878ecd0bbb9acd3fd38f0ce00c
BLAKE2b-256 0719a4956a346d6d8042823266ce48e4f6f5ed1fef0fcaa84c9d312cad4c4d7e

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