-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate prices list for gas with example (#275)
- Loading branch information
1 parent
d8870ef
commit 6b878f9
Showing
3 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters