6
6
7
7
def today ():
8
8
"""
9
- Get today's snapshot of Brain Image Library.
10
- """
9
+ Get today's snapshot of Brain Image Library.
10
+ """
11
11
12
12
server = "https://download.brainimagelibrary.org/inventory/daily/reports/"
13
13
filename = "today.json"
@@ -54,9 +54,11 @@ def __get_contributor(df):
54
54
def __get_affilation (df ):
55
55
return df ["affiliation" ].value_counts ().to_dict ()
56
56
57
+
57
58
def __get_awards (df ):
58
59
return df ["award_number" ].unique ()
59
60
61
+
60
62
def __get_award_number (df ):
61
63
return df ["award_number" ].value_counts ().to_dict ()
62
64
@@ -88,6 +90,7 @@ def __get_technique(df):
88
90
def __get_locations (df ):
89
91
return df ["locations" ].value_counts ().to_dict ()
90
92
93
+
91
94
def __get_contributors (df ):
92
95
"""
93
96
This returns an array of contributor names from the contributorname column.
@@ -96,33 +99,36 @@ def __get_contributors(df):
96
99
97
100
98
101
def __get_project_names (df ):
99
- '''
100
- Gets the unique list of project names.
102
+ """
103
+ Gets the unique list of project names.
101
104
102
105
Input: dataframe
103
- Output: list
104
- '''
105
- return df ['project' ].unique ()
106
+ Output: list
107
+ """
108
+ return df ["project" ].unique ()
109
+
106
110
107
111
def __get_list_of_projects (df ):
108
- '''
112
+ """
109
113
Get the list of names for unique projects
110
114
111
115
Input parameter: dataframe
112
116
Output: list of projects
113
- '''
114
-
115
- return df ['project' ].unique ().to_dict ()
117
+ """
118
+
119
+ return df ["project" ].unique ().to_dict ()
120
+
116
121
117
122
def __get_number_of_projects (df ):
118
- '''
123
+ """
119
124
Get the number of unique projects
120
125
121
126
Input parameter: dataframe
122
127
Output: number of projects
123
- '''
124
-
125
- return len (df ['project' ].unique ())
128
+ """
129
+
130
+ return len (df ["project" ].unique ())
131
+
126
132
127
133
def report ():
128
134
# Get today's date
@@ -136,6 +142,7 @@ def report():
136
142
report = {}
137
143
report ["date" ] = tdate
138
144
report ["number_of_datasets" ] = __get_number_of_datasets (df )
145
+ report ["number_of_project" ] = __get_number_of_projects (df )
139
146
report ["completeness_score" ] = __get_completeness_score (df )
140
147
report ["metadata_version" ] = __get_metadata_version (df )
141
148
report ["contributor" ] = __get_contributor (df )
@@ -148,6 +155,5 @@ def report():
148
155
report ["generalmodality" ] = __get_generalmodality (df )
149
156
report ["technique" ] = __get_technique (df )
150
157
report ["locations" ] = __get_locations (df )
151
- report ["is_reachable" ] = df ["URL" ].apply (__is_reachable )
152
158
153
- return report
159
+ return report
0 commit comments