Last active
February 26, 2017 04:59
-
-
Save Layoric/dc5a4b507e83fc78c8a7d6000f5482e6 to your computer and use it in GitHub Desktop.
Example solcast-py API usage.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)
)