diff options
Diffstat (limited to 'chocula/directories/ezb.py')
-rw-r--r-- | chocula/directories/ezb.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/chocula/directories/ezb.py b/chocula/directories/ezb.py index 1573048..056350d 100644 --- a/chocula/directories/ezb.py +++ b/chocula/directories/ezb.py @@ -1,4 +1,3 @@ - from typing import Iterable, Optional import json @@ -16,7 +15,7 @@ class EzbLoader(DirectoryLoader): source_slug = "ezb" def open_file(self) -> Iterable: - return open(self.config.ezb.filepath, 'r') + return open(self.config.ezb.filepath, "r") def parse_record(self, row) -> Optional[DirectoryInfo]: @@ -26,21 +25,29 @@ class EzbLoader(DirectoryLoader): info = DirectoryInfo( directory_slug=self.source_slug, - issne=row.get('issne'), - issnp=row.get('issnp'), - custom_id=row['ezb_id'], - name=clean_str(row['title']), - publisher=clean_str(row.get('publisher')), + issne=row.get("issne"), + issnp=row.get("issnp"), + custom_id=row["ezb_id"], + name=clean_str(row["title"]), + publisher=clean_str(row.get("publisher")), ) info.extra = dict() - for k in ('ezb_color', 'subjects', 'keywords', 'zdb_id', - 'first_volume', 'first_issue', 'first_year', - 'appearance', 'costs'): + for k in ( + "ezb_color", + "subjects", + "keywords", + "zdb_id", + "first_volume", + "first_issue", + "first_year", + "appearance", + "costs", + ): if row.get(k): info.extra[k] = row[k] - url = HomepageUrl.from_url(row.get('url')) + url = HomepageUrl.from_url(row.get("url")) if url: info.homepage_urls.append(url) |