aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chocula/database.py6
-rw-r--r--chocula/directories/doaj.py4
-rw-r--r--chocula/directories/issn_meta.py4
-rw-r--r--chocula/directories/manual_homepages.py8
-rw-r--r--chocula/directories/vanished_disapeared.py4
-rw-r--r--chocula/directories/vanished_inactive.py4
-rw-r--r--chocula/kbart.py7
-rw-r--r--chocula/util.py2
8 files changed, 28 insertions, 11 deletions
diff --git a/chocula/database.py b/chocula/database.py
index d4fbbed..ecc2858 100644
--- a/chocula/database.py
+++ b/chocula/database.py
@@ -435,7 +435,11 @@ class ChoculaDatabase:
cur = self.db.cursor()
self.db.row_factory = sqlite3.Row
# don't include new journals if they are *only* in hathitrust KBART
- index_issnls = list(cur.execute("SELECT DISTINCT issnl FROM directory WHERE slug != 'hathitrust'"))
+ index_issnls = list(
+ cur.execute(
+ "SELECT DISTINCT issnl FROM directory WHERE slug != 'hathitrust'"
+ )
+ )
fatcat_issnls = list(
cur.execute(
"SELECT DISTINCT issnl FROM fatcat_container WHERE issnl IS NOT null"
diff --git a/chocula/directories/doaj.py b/chocula/directories/doaj.py
index f9531b1..6caa9f6 100644
--- a/chocula/directories/doaj.py
+++ b/chocula/directories/doaj.py
@@ -96,9 +96,7 @@ class DoajLoader(DirectoryLoader):
if row["Preservation Services"]:
info.extra["archive"] = [
- a.strip()
- for a in row["Preservation Services"].split(",")
- if a.strip()
+ a.strip() for a in row["Preservation Services"].split(",") if a.strip()
]
elif row["Preservation Service: national library"]:
info.extra["archive"] = ["national-library"]
diff --git a/chocula/directories/issn_meta.py b/chocula/directories/issn_meta.py
index 4416125..472fda8 100644
--- a/chocula/directories/issn_meta.py
+++ b/chocula/directories/issn_meta.py
@@ -29,7 +29,9 @@ class IssnMetaLoader(DirectoryLoader):
row = json.loads(row)
- info = DirectoryInfo(directory_slug=self.source_slug,)
+ 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(
diff --git a/chocula/directories/manual_homepages.py b/chocula/directories/manual_homepages.py
index 3f84794..4b058b3 100644
--- a/chocula/directories/manual_homepages.py
+++ b/chocula/directories/manual_homepages.py
@@ -11,7 +11,8 @@ class ManualHomepageLoader(DirectoryLoader):
def open_file(self) -> Iterable:
return csv.DictReader(
- open(self.config.manual_homepages.filepath), delimiter="\t",
+ open(self.config.manual_homepages.filepath),
+ delimiter="\t",
)
def parse_record(self, record) -> Optional[DirectoryInfo]:
@@ -35,7 +36,10 @@ class ManualHomepageLoader(DirectoryLoader):
- Inactive
"""
- info = DirectoryInfo(directory_slug=self.source_slug, issnl=record["issnl"],)
+ info = DirectoryInfo(
+ directory_slug=self.source_slug,
+ issnl=record["issnl"],
+ )
url = record["Homepage URL"]
if url is None or url.lower() == "unknown" or len(url) < 4:
return None
diff --git a/chocula/directories/vanished_disapeared.py b/chocula/directories/vanished_disapeared.py
index de25434..36bd66b 100644
--- a/chocula/directories/vanished_disapeared.py
+++ b/chocula/directories/vanished_disapeared.py
@@ -35,7 +35,9 @@ class VanishedDisapearedLoader(DirectoryLoader):
source_slug = "vanished_disapeared"
def open_file(self) -> Iterable:
- return csv.DictReader(open(self.config.vanished_disapeared.filepath), delimiter=";")
+ return csv.DictReader(
+ open(self.config.vanished_disapeared.filepath), delimiter=";"
+ )
def parse_record(self, record) -> Optional[DirectoryInfo]:
diff --git a/chocula/directories/vanished_inactive.py b/chocula/directories/vanished_inactive.py
index 61d6077..3baa079 100644
--- a/chocula/directories/vanished_inactive.py
+++ b/chocula/directories/vanished_inactive.py
@@ -22,7 +22,9 @@ class VanishedInactiveLoader(DirectoryLoader):
source_slug = "vanished_inactive"
def open_file(self) -> Iterable:
- return csv.DictReader(open(self.config.vanished_inactive.filepath), delimiter=";")
+ return csv.DictReader(
+ open(self.config.vanished_inactive.filepath), delimiter=";"
+ )
def parse_record(self, record) -> Optional[DirectoryInfo]:
diff --git a/chocula/kbart.py b/chocula/kbart.py
index 23c5533..0246df9 100644
--- a/chocula/kbart.py
+++ b/chocula/kbart.py
@@ -1,4 +1,9 @@
-from chocula.common import KbartLoader, OnixCsvLoader, CarinianaCsvLoader, HathifilesLoader
+from chocula.common import (
+ KbartLoader,
+ OnixCsvLoader,
+ CarinianaCsvLoader,
+ HathifilesLoader,
+)
class ClockssKbartLoader(KbartLoader):
diff --git a/chocula/util.py b/chocula/util.py
index b915e94..1d4a5d5 100644
--- a/chocula/util.py
+++ b/chocula/util.py
@@ -362,7 +362,7 @@ def test_clean_str():
def clean_issn(s: str) -> Optional[str]:
s = s.strip().upper()
- s = s.replace(' ', '')
+ s = s.replace(" ", "")
if len(s) == 8:
s = s[:4] + "-" + s[4:]
if len(s) != 9 or s[4] != "-":