forked from unplaceable/octopus_energy_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (21 loc) · 830 Bytes
/
main.py
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
from octopus_energy_api.octopus_energy_api import oe_api
from datetime import datetime, timedelta
import os
api_key = os.environ.get("API_KEY")
account_number = os.environ.get("ACCOUNT_NUMBER")
energy_api = oe_api(account_number, api_key)
# print(energy_api.account_details())
today = datetime.today()
start = today - timedelta(days=1)
print(energy_api.meter_point())
# energy_api.consumption(start, today)
# print(energy_api.consumption_total(start, today))
# print(energy_api.consumption_mean(start, today))
# print(energy_api.consumption_median(start, today))
# print(energy_api.consumption_cost(start, today, 2.73))
# print(energy_api.account_details())
# CONSUMPTION
# today = datetime.date.today()
# start = today.replace(day=1)
# print(energy_api.consumption(start, today))
# print(energy_api.products())