forked from aWhereAPI/API-Code-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (30 loc) · 932 Bytes
/
Copy pathmain.py
File metadata and controls
42 lines (30 loc) · 932 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
38
39
40
41
42
import header
import mscvrt
api_key = ""
api_secret = ""
host = "http://api.awhere.com"
auth_token = GetOAuthToken(API_KEY, API_SECRET)
#These variables are used for creating data later in the sample script.
new_field_id = 'mynewfield'
new_field_name = "My New Field"
new_field_farm_id = 'F-1234-14-B'
new_field_latitude = 39.8282
new_field_longitude = -98.5795
new_field_acres = 120
observed_weather_start = "2015-07-24"
observed_weather_end = "2015-07-31"
forecast_weather_start = date("Y-m-d")
forecast_weather_end = date("Y-m-d",strtotime("+ 3 days"))
while True:
print 'Select a request option'
print
print '1. Get All Fields'
print '2. Create A Field'
print '3. Get Weather Observations'
print '4. Get Weather Forecasts'
print '5. Get Three Year Weather Norms'
print '6. Get Ten Year Weather Norms'
print 'q - Quit'
switch = input()
if value == 'q':
break;