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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c64e4b226f7e9e822746f24e253494cc4d8a628e02668d1ac8385da8ac3697b3
|
|
| MD5 |
56e7c775f5eab755c58f0d4ccda6a8e1
|
|
| BLAKE2b-256 |
982596b6f6f713c14c6c1b5bc4c63f4adfce7ad8ec4a05a8a69a254eab248d12
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e729001bf1a874c7c829c76396716dbf1281ccdc2c3ea561676b039945019ef7
|
|
| MD5 |
7ed2ed22baf0c75370f4bcbaffc48561
|
|
| BLAKE2b-256 |
e7a449833e1b371e212ada8792d858e1d526fc0975d9badb62b458e140cf9041
|