Init with the region code (Don't include the _) as per: https://en.wikipedia.org/wiki/Distribution_network_operator
Feel free to use my referral code and get £50 credit to your account (as well as mine): https://share.octopus.energy/lilac-bison-793
Now available in pypi!
pip install OctopusAgile
from OctopusAgile import Agile
agile = Agile('N') # N is the region code for Southern Scotland
agile.get_new_rates()
agile.get_current_rate()
agile.get_next_rate()
agile.get_next_rate()
from OctopusAgile import Outgoing
outgoing = Outgoing('N') # N is the region code for Southern Scotland
outgoing.get_new_rates()
outgoing.get_current_rate()
outgoing.get_next_rate()
outgoing.get_next_rate()
All time formats are "%Y-%m-%dT%H:%M:%SZ" e.g. 2020-04-16T06:00:00Z
Returns the raw data as given to us by the API
Returns a dict of:
- date_rate (dict): Dict of date/time as key and rate as vaue
- rate_list (list): All Rates as a list
- low_rate_list (list): All Rates below 15p
Returns the same dict as get_rate for the past "day_delta" days
Print a summary of the rates for the past "days" days
Get a date_rate dict of the cheapest time period of "hours" hours.
in_d is a date_rate dict.
Get a date_rate dict of any times below "limit"
in_d is a date_rate dict.
Get a date rate dict of "num" number of time periods in in_d.
in_d is a date_rate dict.
Requirements a list of dicts with details of particular times that must be includes in the returned date_rate dict.
Example, must have 2 slots between 1900 and 0600: {'slots': 2, 'time_from': '2020-04-15T19:00:00Z', 'time_to': '2020-04-16T06:00:00Z'}
Return the area code that is being used
Return all available future rates
Return the previous period rate
Return the current period rate
Return the next period rate
Get a date_rate dict of "num" number of max periods