Beispiel #1
0
    def parse_record(self, row) -> Optional[DirectoryInfo]:
        # super mangled :(

        row.update(self.sherpa_policies[row["RoMEO Record ID"]])

        info = DirectoryInfo(
            directory_slug=self.source_slug,
            issnp=row["ISSN"],
            issne=row["ESSN"],
            name=clean_str(row["Journal Title"]),
            publisher=clean_str(row["Publisher"]),
            country=parse_country(row["Country"]),
            custom_id=row["RoMEO Record ID"],
        )

        if row["RoMEO colour"]:
            info.extra["color"] = row["RoMEO colour"]

        return info
Beispiel #2
0
    def parse_record(self, row) -> Optional[DirectoryInfo]:
        # TODO: Subjects, Permanent article identifiers, work_level stuff

        info = DirectoryInfo(
            directory_slug=self.source_slug,
            issnp=row["Journal ISSN (print version)"],
            issne=row["Journal EISSN (online version)"],
            name=clean_str(row["Journal title"]),
            publisher=clean_str(row["Publisher"]),
            country=parse_country(row["Country of publisher"]),
        )

        lang = parse_lang(
            row["Languages in which the journal accepts manuscripts"])
        if lang:
            info.langs.append(lang)

        info.extra["as_of"] = self.config.snapshot.date
        if row["DOAJ Seal"]:
            info.extra["seal"] = {
                "no": False,
                "yes": True
            }[row["DOAJ Seal"].lower()]

        if row["Preservation Services"]:
            info.extra["archive"] = [
                a.strip() for a in row["Preservation Services"].split(",")
                if a.strip()
            ]
        elif row["Preservation Service: national library"]:
            info.extra["archive"] = ["national-library"]

        default_license = row["Journal license"]
        if default_license and default_license.startswith("CC"):
            info.extra["default_license"] = default_license.replace(
                "CC ", "CC-").strip()

        url = row["Journal URL"]
        if url:
            homepage = HomepageUrl.from_url(row["Journal URL"])
            if homepage:
                info.homepage_urls.append(homepage)
        return info
Beispiel #3
0
    def parse_record(self, row) -> Optional[DirectoryInfo]:

        row = json.loads(row)

        info = DirectoryInfo(
            directory_slug=self.source_slug,
        )
        # format is an array of metadata elements
        for el in row:
            if "label" in el and el["@id"].startswith(
                "http://id.loc.gov/vocabulary/countries"
            ):
                value = el["label"]
                if "(State)" in value:
                    value = ""
                if value == "Russia (Federation)":
                    value = "Russia"
                info.country = parse_country(el["label"])
            if not "@type" in el:
                continue
            if el["@type"] == "http://id.loc.gov/ontologies/bibframe/IssnL":
                info.issnl = clean_issn(el["value"])
            if "mainTitle" in el:
                if type(el["mainTitle"]) == list:
                    info.name = clean_str(el["mainTitle"][0])
                else:
                    info.name = clean_str(el["mainTitle"])
                if el.get("format") == "vocabularies/medium#Print":
                    info.issnp = clean_issn(el["issn"])
                elif el.get("format") == "vocabularies/medium#Electronic":
                    info.issne = clean_issn(el["issn"])
            urls = el.get("url", [])
            if isinstance(urls, str):
                urls = [
                    urls,
                ]
            for url in urls:
                homepage = HomepageUrl.from_url(url)
                if homepage:
                    info.homepage_urls.append(homepage)

        return info
    def parse_record(self, record) -> Optional[DirectoryInfo]:

        if not record["Journal Name"]:
            return None

        info = DirectoryInfo(
            directory_slug=self.source_slug,
            raw_issn=clean_issn(record["ISSN"]),
            issne=clean_issn(record["E-ISSN"]),
            name=clean_str(record["Journal Name"]),
            publisher=clean_str(record["Publisher"]),
            langs=[
                lang for lang in [parse_lang(record["Language(s)"])] if lang
            ],
            country=parse_country(record["Country"]),
        )
        homepage = HomepageUrl.from_url(record["Internet Archive Link"])
        if homepage:
            info.homepage_urls.append(homepage)
        return info
Beispiel #5
0
    def parse_record(self, row) -> Optional[DirectoryInfo]:
        info = DirectoryInfo(
            directory_slug=self.source_slug,
            issnp=row["Print ISSN"],
            issne=row["Online ISSN"],
            custom_id=clean_str(row["NSD tidsskrift_id"]),
            publisher=clean_str(row["Publisher"]),
            country=parse_country(row["Country of publication"]),
            name=clean_str(row.get("International title")),
            langs=[lang for lang in [parse_lang(row["Language"])] if lang],
        )

        info.extra["as_of"] = self.config.norwegian.date
        if row["Level 2019"]:
            info.extra["level"] = int(row["Level 2019"])

        if row["Original title"] != row["International title"]:
            info.original_name = clean_str(row["Original title"])

        url = HomepageUrl.from_url(row["URL"])
        if url:
            info.homepage_urls.append(url)

        return info