File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 33
33
34
34
from prisma import Prisma
35
35
from prisma .types import JournalCitationInfoYearlyCreateWithoutRelationsInput
36
+ from tqdm import tqdm
36
37
37
38
# current_year should be the latest year of data available at https://www.scimagojr.com/journalrank.php
38
39
current_year = 2022
@@ -137,8 +138,7 @@ def download_all_data():
137
138
def combine_data ():
138
139
"""Iterate over files and return the consolidated dataset"""
139
140
journals : dict [int , JournalInfo ] = {}
140
- for year in range (start_year , current_year + 1 ):
141
- print (f'Processing { year } ' )
141
+ for year in tqdm (range (start_year , current_year + 1 ), desc = 'Processing data' ):
142
142
filepath = get_data_filepath (year )
143
143
with open (filepath , mode = 'r' , encoding = 'utf-8' ) as csv_file :
144
144
csv_reader = csv .DictReader (csv_file , delimiter = ';' )
@@ -212,7 +212,7 @@ async def dump_into_database(journals: dict[int, JournalInfo]):
212
212
# delete all existing yearly data (because its easier than updating)
213
213
await db .journalcitationinfoyearly .delete_many ()
214
214
215
- for journal in journals .values ():
215
+ for journal in tqdm ( journals .values (), desc = 'Saving to database' ):
216
216
citation_info : list [JournalCitationInfoYearlyCreateWithoutRelationsInput ] = [
217
217
{
218
218
'year' : year ,
You can’t perform that action at this time.
0 commit comments