GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-frank-energie/example.py at main · HiDiHo01/python-frank-energie Expand file tree/ Copy pathexample.pyMore file actions 45 lines (30 loc) · 1.58 KB / Copy pathexample.pyFile metadata and controls45 lines (30 loc) · 1.58 KB 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 """Example of using python-frank-energie.""" import asyncio import os from datetime import datetime, timedelta from python_frank_energie import FrankEnergie async def main(): """Fetch and print data from Frank energie.""" today = datetime.utcnow().date() tomorrow = today + timedelta(days=1) day_after_tomorrow = today + timedelta(days=2) async with FrankEnergie() as fe: prices_today = await fe.prices(today, tomorrow) prices_tomorrow = await fe.prices(tomorrow, day_after_tomorrow) for price in (prices_today.electricity + prices_tomorrow.electricity).all: print(f"Electricity: {price.date_from} -> {price.date_till}: {price.total}") for price in (prices_today.gas + prices_tomorrow.gas).all: print(f"Gas: {price.date_from} -> {price.date_till}: {price.total}") async with FrankEnergie() as fe: authToken = await fe.login(os.getenv("USERNAME"), os.getenv("PASSWORD")) user_prices_today = await fe.userPrices(today) user_prices_tomorrow = await fe.userPrices(tomorrow) for price in (user_prices_today.electricity + user_prices_tomorrow.electricity).all: print(f"Electricity: {price.date_from} -> {price.date_till}: {price.total}") for price in (user_prices_today.gas + user_prices_tomorrow.gas).all: print(f"Gas: {price.date_from} -> {price.date_till}: {price.total}") print(await fe.monthSummary()) async with FrankEnergie(auth_token=authToken.authToken) as fe: print(await fe.monthSummary()) print(await fe.me()) asyncio.run(main()) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |