aboutsummaryrefslogtreecommitdiffstats
path: root/chocula.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-12-23 19:12:22 -0800
committerBryan Newbold <bnewbold@archive.org>2019-12-23 19:12:22 -0800
commit786f48e891826876ee63c93e5c09e1e89975fa8d (patch)
tree7eec00b14f4d65c7ce2a41a89e53d538e8312f50 /chocula.py
parentfaaefd2a2a998551b50b7de5c8e231d53b55882a (diff)
downloadchocula-786f48e891826876ee63c93e5c09e1e89975fa8d.tar.gz
chocula-786f48e891826876ee63c93e5c09e1e89975fa8d.zip
update norwegian CSV importer schema
Diffstat (limited to 'chocula.py')
-rwxr-xr-xchocula.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/chocula.py b/chocula.py
index c8173a3..f2e1b79 100755
--- a/chocula.py
+++ b/chocula.py
@@ -652,7 +652,8 @@ class ChoculaDatabase():
path = args.input_file or NORWEGIAN_FILE
print("##### Loading Norwegian Registry...")
#pandas.read_csv(NORWEGIAN_FILE, sep=';', encoding="ISO-8859-1")
- #NSD tidsskrift_id;Original title;International title;Present Level (2018);Print ISSN;Online ISSN;Open Access;NPI Scientific Field;NPI Academic Discipline;URL;Publishing Company;Publisher;Country of publication;Language;Level 2019;Level 2018;Level 2017;Level 2016;Level 2015;Level 2014;Level 2013;Level 2012;Level 2011;Level 2010;Level 2009;Level 2008;Level 2007;Level 2006;Level 2005;Level 2004;itar_id
+ # Old: NSD tidsskrift_id;Original title;International title;Present Level (2018);Print ISSN;Online ISSN;Open Access;NPI Scientific Field;NPI Academic Discipline;URL;Publishing Company;Publisher;Country of publication;Language;Level 2019;Level 2018;Level 2017;Level 2016;Level 2015;Level 2014;Level 2013;Level 2012;Level 2011;Level 2010;Level 2009;Level 2008;Level 2007;Level 2006;Level 2005;Level 2004;itar_id
+ # New: NSD tidsskrift_id;Original title;International title;Print ISSN;Online ISSN;Open Access;NPI Academic Discipline;NPI Scientific Field;Level 2020;Level 2019;Level 2018;Level 2017;Level 2016;Level 2015;Level 2014;Level 2013;Level 2012;Level 2011;Level 2010;Level 2009;Level 2008;Level 2007;Level 2006;Level 2005;Level 2004;itar_id;NSD forlag_id;Publishing Company;Publisher;Country of publication;Language;Conference Proceedings;Established;Ceased;URL
reader = csv.DictReader(open(path, encoding="ISO-8859-1"), delimiter=";")
counts = Counter()
self.c = self.db.cursor()
@@ -667,7 +668,8 @@ class ChoculaDatabase():
counts['no-issn'] += 1
continue
extra = dict(as_of=NORWEGIAN_DATE)
- extra['level'] = int(row['Present Level (2018)'])
+ if row['Level 2019']:
+ extra['level'] = int(row['Level 2019'])
if row['Original title'] != row['International title']:
extra['original_name'] = row['Original title']
if row['Country of publication']: