Commit
·
8f664d2
1
Parent(s):
dce77b2
Initialize data structure in fetch_data function and update main execution with user access key
Browse files- fetch_data.py +2 -1
fetch_data.py
CHANGED
@@ -21,6 +21,7 @@ def fetch_data(user_access_key):
|
|
21 |
papers_data = {}
|
22 |
try:
|
23 |
papers_data['status'] = 'success'
|
|
|
24 |
with ThreadPoolExecutor() as executor:
|
25 |
arxiv_future = executor.submit(fetch_arxiv_data)
|
26 |
pmc_future = executor.submit(fetch_pmc_data)
|
@@ -45,6 +46,6 @@ def fetch_data(user_access_key):
|
|
45 |
return data
|
46 |
|
47 |
if __name__ == '__main__':
|
48 |
-
data = fetch_data()
|
49 |
with open('data.json', 'w') as f:
|
50 |
f.write(data)
|
|
|
21 |
papers_data = {}
|
22 |
try:
|
23 |
papers_data['status'] = 'success'
|
24 |
+
papers_data['data'] = {}
|
25 |
with ThreadPoolExecutor() as executor:
|
26 |
arxiv_future = executor.submit(fetch_arxiv_data)
|
27 |
pmc_future = executor.submit(fetch_pmc_data)
|
|
|
46 |
return data
|
47 |
|
48 |
if __name__ == '__main__':
|
49 |
+
data = fetch_data(ACCESS_KEY)
|
50 |
with open('data.json', 'w') as f:
|
51 |
f.write(data)
|