Skip to content

Instantly share code, notes, and snippets.

@Layoric
Last active February 26, 2017 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Layoric/dc5a4b507e83fc78c8a7d6000f5482e6 to your computer and use it in GitHub Desktop.
Save Layoric/dc5a4b507e83fc78c8a7d6000f5482e6 to your computer and use it in GitHub Desktop.
Example solcast-py API usage.
import solcast
# Fetch latest PV power forecast
pv_power_resp = solcast.get_pv_power_forecasts(-35, 149, capacity=2000, tilt=23, azimuth=0, api_key='INSERTYOURAPIKEYHERE')
# Print soonest PV power forecast
print(pv_power_resp.forecasts[0]['pv_estimate'])
@cjtapper
Copy link

cjtapper commented Feb 6, 2017

Couldn't work out how to edit (not even sure if I'm able to edit?), but you missed an 'e' in forecasts on line 3. Also, should probably modify line 3 to use the brackets syntax for print so that it's compatible with both 2.7 and 3.* (i.e., print(pv_power_resp.forecasts[0].pv_estimate))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment