File: prices_list.py

package info (click to toggle)
python-energyzero 2.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 616 kB
  • sloc: python: 668; makefile: 8; sh: 5
file content (25 lines) | stat: -rw-r--r-- 696 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Asynchronous Python client for the EnergyZero API."""

import asyncio
from datetime import date

from energyzero import EnergyZero, VatOption


async def main() -> None:
    """Show example on fetching the timestamp lists from EnergyZero."""
    async with EnergyZero(vat=VatOption.INCLUDE) as client:
        today = date(2023, 12, 5)
        energy = await client.energy_prices(start_date=today, end_date=today)
        gas = await client.gas_prices(start_date=today, end_date=today)

        print("--- ENERGY ---")
        print(energy.timestamp_prices)
        print()

        print("--- GAS ---")
        print(gas.timestamp_prices)


if __name__ == "__main__":
    asyncio.run(main())