forked from ZeevG/python-forecast.io
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
Latest commit
37 lines (25 loc) · 846 Bytes
/
Copy pathexample.py
File metadata and controls
37 lines (25 loc) · 846 Bytes
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
importdatetime
importforecastio
defmain():
"""
Run load_forecast() with the given lat, lng, and time arguments.
"""
api_key="YOUR API KEY"
lat=-31.967819
lng=115.87718
time=datetime.datetime(2015, 2, 27, 6, 0, 0)
forecast=forecastio.load_forecast(api_key, lat, lng, time=time)
print"===========Currently Data========="
printforecast.currently()
print"===========Hourly Data========="
by_hour=forecast.hourly()
print"Hourly Summary: %s"% (by_hour.summary)
forhourly_data_pointinby_hour.data:
printhourly_data_point
print"===========Daily Data========="
by_day=forecast.daily()
print"Daily Summary: %s"% (by_day.summary)
fordaily_data_pointinby_day.data:
printdaily_data_point
if__name__=="__main__":
main()