-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
41 lines (35 loc) · 1.24 KB
/
README
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
Requirements
You will be building a simple RPC application to check crime report for a location. You will be using Spyne toolkit to build the application. Input protocol is HttpRpc and output is JSON as described below.
Input (HttpRpc)
lat - latitude of a location
lon - longitude of a location
radius - radius distance in miles.
Sample input: curl "http://localhost:8000/checkcrime?lat=37.334164&lon=-121.884301&radius=0.02"
Sample Output (Json)
{
"total_crime" : 24,
"the_most_dangerous_streets" : [ "E SANTA CLARA ST", "E SAN FERNANDO ST" , "N 11TH ST" ],
"crime_type_count" : {
"Assault" : 10,
"Arrest" : 8,
"Burglary" : 6,
"Robbery" : 4,
"Theft" : 2,
"Other" : 1
},
"event_time_count" : {
"12:01am-3am" : 5,
"3:01am-6am" : 0,
"6:01am-9am" : 1,
"9:01am-12noon" : 2,
"12:01pm-3pm" : 2,
"3:01pm-6pm" : 1,
"6:01pm-9pm" : 0,
"9:01pm-12midnight" : 9
}
}
the_most_dangerous_streets: Top 3 streets only. It can be less than 3 streets if a location doesn't have enough crime.
Dependency
CrimeReport API
# Example Crime Report near SJSU
curl -i "https://api.spotcrime.com/crimes.json?lat=37.334164&lon=-121.884301&radius=0.02&key=."