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.0.tar.gz
(5.3 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.0.tar.gz.
File metadata
- Download URL: switch2-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da251c73c3d33cea904eda2dfc7101c3a25fceea0d557febdd241ba49b22dfa7
|
|
| MD5 |
cfded507c1c3b0c082f599d5d32e99ca
|
|
| BLAKE2b-256 |
766b7105fa460ae9365ed0f0c7450b9b4e56b910c3d930e48f81b9ee8a57cbb9
|
File details
Details for the file switch2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: switch2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 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 |
57e7fb38f4cc850429599a5d6d8b371e1fc03a74649fcfc9b51e59a487d8a3c7
|
|
| MD5 |
502336a3b7565a8df32428a6bfc9749f
|
|
| BLAKE2b-256 |
73430748b31fde4e4a39a043c84f71558f2fed4cc04f214aa651796fe4b9942b
|