File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 3
3
import json
4
4
from datetime import date
5
5
6
+ link = "https://download.brainimagelibrary.org"
7
+
6
8
def today ():
7
9
"""
8
10
Get today's snapshot of Brain Image Library.
9
11
"""
10
12
11
- server = "https://download.brainimagelibrary.org /inventory/daily/reports/"
13
+ server = f" { link } /inventory/daily/reports/"
12
14
filename = "today.json"
13
15
14
16
response = requests .get (f"{ server } { filename } " )
@@ -71,6 +73,20 @@ def __get_technique(df):
71
73
def __get_locations (df ):
72
74
return df ['locations' ].value_counts ().to_dict ()
73
75
76
+ def __get_json_file (df ):
77
+ """
78
+ Retrieve the json_file from the Brain Image Library of a dataset.
79
+ """
80
+
81
+ # Make sure there is data to request
82
+ assert df ['score' ].values [0 ] != 0
83
+
84
+ # Create working link
85
+ url = sample ['json_file' ].values [0 ].replace ('/bil/data' , link )
86
+ response = requests .get (url )
87
+
88
+ return response .json ()
89
+
74
90
def report ():
75
91
# Get today's date
76
92
tdate = date .today ()
You can’t perform that action at this time.
0 commit comments