-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (27 loc) · 1010 Bytes
/
main.py
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
# Import necessary modules or packages
import requests
from data import processData
# Define functions or classes if required
def main():
# Your code here
service_calls_base_url = 'https://data.sfgov.org/resource/RowID.json'
filters = {
'call_type': 'Medical Incident',
'$order': 'call_date DESC',
}
api_key = "1t43a568i2ojhn4rpgthr7o3u"
api_secret = "3fmtl0ym0tfl0riykpkmsty9vtixktsy6bd6gsbm5wwkwzl5mp"
credentials = (api_key, api_secret)
response = requests.get(service_calls_base_url, params=filters, auth=credentials)
if response.status_code == 200:
# Request was successful
data = response.json() # Get the response data as JSON
# Process the data as needed
processData(data)
#print(json.dumps(data, indent=2))
else:
# Request failed
print('Request failed with status code:', response.status_code)
# Call the main function to execute your script
if __name__ == '__main__':
main()