diff options
-rw-r--r-- | chocula/directories/australian_era.py | 54 | ||||
-rw-r--r-- | tests/files/era_2018_journal_list.csv | 25 |
2 files changed, 79 insertions, 0 deletions
diff --git a/chocula/directories/australian_era.py b/chocula/directories/australian_era.py new file mode 100644 index 0000000..3323d97 --- /dev/null +++ b/chocula/directories/australian_era.py @@ -0,0 +1,54 @@ +from typing import Iterable, Optional +import csv + +from chocula.util import clean_str +from chocula.common import DirectoryLoader +from chocula.database import DirectoryInfo + + +class AustralianEraLoader(DirectoryLoader): + """ + Using this primarily as + + CSV Columns (2018 file): + + ERA Journal Id + Title + Foreign Title + FoR 1 + FoR 1 Name + FoR 2 + FoR 2 Name + FoR 3 + FoR 3 Name + ISSN 1 + ISSN 2 + ISSN 3 + ISSN 4 + ISSN 5 + ISSN 6 + ISSN 7 + """ + + source_slug = "australian_era" + + def open_file(self) -> Iterable: + return csv.DictReader(open(self.config.australian_era.filepath)) + + def parse_record(self, row) -> Optional[DirectoryInfo]: + info = DirectoryInfo( + directory_slug=self.source_slug, + raw_issn=row["ISSN 1"], + custom_id=clean_str(row["ERA Journal Id"]), + name=clean_str(row.get("Title")), + original_name=clean_str(row.get("Foreign Title")), + extra=dict( + australian_era=dict( + era_id=clean_str(row["ERA Journal Id"]), + field=clean_str(row["FoR 1 Name"]), + field_code=clean_str(row["FoR 1"]), + ) + ), + ) + + return info diff --git a/tests/files/era_2018_journal_list.csv b/tests/files/era_2018_journal_list.csv new file mode 100644 index 0000000..46a66a2 --- /dev/null +++ b/tests/files/era_2018_journal_list.csv @@ -0,0 +1,25 @@ +ERA Journal Id,Title,Foreign Title,FoR 1,FoR 1 Name,FoR 2,FoR 2 Name,FoR 3,FoR 3 Name,ISSN 1,ISSN 2,ISSN 3,ISSN 4,ISSN 5,ISSN 6,ISSN 7 +1,Abstract and Applied Analysis,,0101,Pure Mathematics,,,,,1085-3375,1687-0409,,,,, +2,ACM Transactions on Mathematical Software,,0802,Computation Theory and Mathematics,0806,Information Systems,,,0098-3500,1557-7295,,,,, +3,Acta Applicandae Mathematicae,,0101,Pure Mathematics,0102,Applied Mathematics,0202,"Atomic, Molecular, Nuclear, Particle and Plasma Physics",0167-8019,1572-9036,,,,, +4,Acta Arithmetica,,0101,Pure Mathematics,0802,Computation Theory and Mathematics,,,0065-1036,1730-6264,,,,, +5,Acta Mathematica,,0101,Pure Mathematics,,,,,0001-5962,1871-2509,,,,, +6,Studia Universitatis Babes-Bolyai Mathematica,,0101,Pure Mathematics,,,,,0252-1938,,,,,, +7,Acta Mathematica Hungarica,,0101,Pure Mathematics,,,,,0236-5294,1588-2632,,,,, +9,Acta Mathematica Sinica,,0101,Pure Mathematics,,,,,0583-1431,1439-7617,1439-8516,,,, +10,Acta Mathematica Vietnamica,,0101,Pure Mathematics,,,,,0251-4184,,,,,, +8940,Linguistica Pragensia,,2004,Linguistics,,,,,0862-8432,,,,,, +17858,"Future Generation Computer Systems: the international journal of grid computing: theory, methods and applications",,0803,Computer Software,0805,Distributed Computing,0806,Information Systems,0167-739X,1872-7115,,,,, +124088,Arts of Asia,,19,Studies in Creative Arts and Writing,21,History and Archaeology,,,0004-4083,,,,,, +30445,Home Healthcare Nurse,,1110,Nursing,,,,,0884-741X,,,,,, +124392,Accounting History Review,,1501,"Accounting, Auditing and Accountability",1503,Business and Management,2202,History and Philosophy of Specific Fields,0958-5206,1466-4275,2155-2851,2155-286X,,, +210064,Aesthetic Investigations,,2203,Philosophy,,,,,2352-2704,,,,,, +15630,American Journal of Clinical Dermatology,,1103,Clinical Sciences,,,,,1175-0561,,,,,, +4048,Landslides,,0406,Physical Geography and Environmental Geoscience,0905,Civil Engineering,,,1612-510X,1612-5118,,,,, +31113,Journal of International Management,,1503,Business and Management,1505,Marketing,,,1075-4253,1873-0620,,,,, +32002,ACM Transactions on Computing Education,,0806,Information Systems,0899,Other Information and Computing Sciences,1301,Education Systems,1531-4278,1946-6226,,,,, +210815,Journal Of Cancer,,1112,Oncology and Carcinogenesis,,,,,1837-9664,,,,,, +41077,"Papers and Proceedings of the Royal Society of Tasmania, Hobart",,0403,Geology,0699,Other Biological Sciences,1601,Anthropology,0080-4703,,,,,, +6698,Women and Therapy: a feminist quarterly,,1699,Other Studies in Human Society,1701,Psychology,,,0270-3149,1541-0315,,,,, +44506,Alcoholism,,1109,Neurosciences,1117,Public Health and Health Services,,,0002-502X,,,,,, +41407,The Open Nuclear Medicine Journal,,1103,Clinical Sciences,,,,,1876-388X,,,,,, |