File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ def get_grants_aggregates(json_data):
106
106
duplicate_ids = set ()
107
107
max_award_date = ""
108
108
min_award_date = ""
109
+ award_years = {}
109
110
distinct_funding_org_identifier = set ()
110
111
distinct_recipient_org_identifier = set ()
111
112
currencies = {}
@@ -139,6 +140,12 @@ def get_grants_aggregates(json_data):
139
140
140
141
award_date = str (grant .get ("awardDate" , "" ))
141
142
if award_date :
143
+ try :
144
+ year = award_date [:4 ]
145
+ # count up the tally of grants in `year`
146
+ award_years [year ] = award_years [year ] + 1
147
+ except KeyError :
148
+ award_years [year ] = 1
142
149
max_award_date = max (award_date , max_award_date )
143
150
if not min_award_date :
144
151
min_award_date = award_date
@@ -182,6 +189,7 @@ def get_grants_aggregates(json_data):
182
189
"duplicate_ids" : duplicate_ids ,
183
190
"max_award_date" : max_award_date .split ("T" )[0 ],
184
191
"min_award_date" : min_award_date .split ("T" )[0 ],
192
+ "award_years" : award_years ,
185
193
"distinct_funding_org_identifier" : distinct_funding_org_identifier ,
186
194
"distinct_recipient_org_identifier" : distinct_recipient_org_identifier ,
187
195
"currencies" : currencies ,
You can’t perform that action at this time.
0 commit comments