From 31adaa92ea7728b6914f8c21e2ca9287b4f027e9 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 15 Jan 2024 11:29:11 +0000 Subject: [PATCH] Fix some data issues --- app/sources/rosetta/api.py | 2 +- app/sources/rosetta/lib/response_parser.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/sources/rosetta/api.py b/app/sources/rosetta/api.py index a113c2d..dfb71ed 100644 --- a/app/sources/rosetta/api.py +++ b/app/sources/rosetta/api.py @@ -116,7 +116,7 @@ def parse_results(self, raw_results, source_url): record = RecordCreatorPerson(parsed_data.id()) record.name = parsed_data.name() record.name_parts = parsed_data.names() - record.date = parsed_data.lifespan() + record.date = parsed_data.date() record.gender = parsed_data.gender() record.identifier = parsed_data.identifier() record.functions = parsed_data.functions() diff --git a/app/sources/rosetta/lib/response_parser.py b/app/sources/rosetta/lib/response_parser.py index 9e15bc0..48dcbdc 100644 --- a/app/sources/rosetta/lib/response_parser.py +++ b/app/sources/rosetta/lib/response_parser.py @@ -73,7 +73,7 @@ def name(self) -> str: names = self.names() if "name" in names: return names["name"] - return "" + return self.title() or "" def names(self) -> dict: names = {} @@ -250,7 +250,9 @@ def contact_info(self) -> dict: ): document = PyQuery(ephemera) return { - "address_line_1": document("addressline1").text(), + "address_line_1": document("addressline1") + .text() + .replace("

", ", "), "town": document("addresstown").text(), "postcode": document("postcode").text(), "country": document("addresscountry").text(),