Open peterdudfield opened 11 months ago
Have coded this module... needs to be generalised a bit so you can add support for all endpoints but hopefully will be useful...
Download all forecasts covering a given period that were created during a given period
from datetime import datetime, time, timedelta
import pytz
from ocf_quartz_api import OCFQuartz
GSP_IDS= [0, 1, 2]
START = pytz.utc.localize(datetime.combine(date.today(), time(0, 30)))
END = pytz.utc.localize(datetime.combine(date.today()+ timedelta(days=1), time(0)))
FORECAST_START = START - timedelta(days=1)
# N.B. `ocf_creds` could also be a Path to YAML file containing these params
ocf_creds = {
"username": "REDACTED",
"password": "REDACTED"
}
quartz = OCFQuartz(
credentials=ocf_creds,
proxies=None
)
ocf_forecasts = quartz.get_forecasts(
forecast_start=FORECAST_START ,
forecast_end=END,
target_start=START,
target_end=END,
forecast_base_times=None,
gsp_ids=GSP_IDS
)
Detailed Description
Create a python package for this api
Context
Possible Implementation