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 33import json
44from datetime import date
55
6+ link = "https://download.brainimagelibrary.org"
7+
68def today ():
79 """
810 Get today's snapshot of Brain Image Library.
911 """
1012
11- server = "https://download.brainimagelibrary.org /inventory/daily/reports/"
13+ server = f" { link } /inventory/daily/reports/"
1214 filename = "today.json"
1315
1416 response = requests .get (f"{ server } { filename } " )
@@ -71,6 +73,20 @@ def __get_technique(df):
7173def __get_locations (df ):
7274 return df ['locations' ].value_counts ().to_dict ()
7375
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+
7490def report ():
7591 # Get today's date
7692 tdate = date .today ()
You can’t perform that action at this time.
0 commit comments