rara-tools 0.6.6__py3-none-any.whl → 0.6.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rara-tools might be problematic. Click here for more details.

@@ -47,4 +47,4 @@ class BaseMARCParser:
47
47
 
48
48
  def save_as_jl(self, jl_file_path: str) -> NoReturn:
49
49
  for record in self.record_generator():
50
- self._write_line(record.full_record, jl_file_path)
50
+ self._write_line(record, jl_file_path)
@@ -110,7 +110,7 @@ class PersonRecord(BaseRecord):
110
110
  self.__birth_year = self._parse_year(birth_year)
111
111
  self.__death_year = self._parse_year(death_year)
112
112
  except Exception as e:
113
- LOGGER.error(
113
+ LOGGER.warning(
114
114
  f"Failed extracting birth and/or death year " \
115
115
  f"from '{self.life_years}' with the following " \
116
116
  f"exception: '{e}'."
@@ -126,7 +126,7 @@ class PersonRecord(BaseRecord):
126
126
  self.__birth_year = self._parse_year(birth_year)
127
127
  self.__death_year = self._parse_year(death_year)
128
128
  except Exception as e:
129
- LOGGER.error(
129
+ LOGGER.warning(
130
130
  f"Failed extracting birth and/or death year " \
131
131
  f"from '{self.life_years}' with the following " \
132
132
  f"exception: '{e}'."
@@ -131,7 +131,7 @@ class TitleRecord(BaseRecord):
131
131
  self.__author_birth_year = self._parse_year(birth_year)
132
132
  self.__author_death_year = self._parse_year(death_year)
133
133
  except Exception as e:
134
- LOGGER.error(
134
+ LOGGER.warning(
135
135
  f"Failed extracting birth and/or death year " \
136
136
  f"from '{self.author_life_years}' with the following " \
137
137
  f"exception: '{e}'."
@@ -147,7 +147,7 @@ class TitleRecord(BaseRecord):
147
147
  self.__author_birth_year = self._parse_year(birth_year)
148
148
  self.__author_death_year = self._parse_year(death_year)
149
149
  except Exception as e:
150
- LOGGER.error(
150
+ LOGGER.warning(
151
151
  f"Failed extracting birth and/or death year " \
152
152
  f"from '{self.author_life_years}' with the following " \
153
153
  f"exception: '{e}'."
@@ -46,9 +46,9 @@ class PersonalName:
46
46
  try:
47
47
  last_name, first_name = self.__original_name.split(",")
48
48
  except Exception as e:
49
- LOGGER.error(
50
- f"Parsing personal name {self.__original_name} " \
51
- f"failed with error: {e}."
49
+ LOGGER.warning(
50
+ f"Parsing personal name '{self.__original_name}' " \
51
+ f"failed with error: {e}. Keeping unformatted version."
52
52
  )
53
53
  else:
54
54
  name_tokens = [
@@ -70,12 +70,16 @@ class PersonalName:
70
70
  if not self.__last_comma_first:
71
71
  if self.last_name or self.first_name:
72
72
  self.__last_comma_first = f"{self.last_name}, {self.first_name}"
73
+ else: self.__last_comma_first = self.__original_name
73
74
  return self.__last_comma_first.strip()
74
75
 
75
76
  @property
76
77
  def first_last(self) -> str:
77
78
  if not self.__first_last:
78
- self.__first_last = f"{self.first_name} {self.last_name}"
79
+ if self.first_name or self.last_name:
80
+ self.__first_last = f"{self.first_name} {self.last_name}"
81
+ else:
82
+ self.__first_last = self.__original_name
79
83
  return self.__first_last.strip()
80
84
 
81
85
 
@@ -2,7 +2,7 @@ import pymarc
2
2
  from typing import NoReturn
3
3
 
4
4
 
5
- class MarcConveter:
5
+ class MarcConverter:
6
6
  def __init__(self):
7
7
  pass
8
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rara-tools
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: Tools to support Kata's work.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -20,7 +20,7 @@ rara_tools/normalizers/authorities.py,sha256=IDtcm0yNZNhv1f-WcdqWFSRzZk_CoKuBFsk
20
20
  rara_tools/normalizers/base.py,sha256=LbS7Y7CEL-C-ynT-WPc-eCLkNeMO9BI9qtBm-W1skGM,11790
21
21
  rara_tools/normalizers/bibs.py,sha256=4DTS6k37z8qR5B3n7aiCXsT5Z49rLTvQ60lKKr5dyLs,2352
22
22
  rara_tools/normalizers/viaf.py,sha256=IA_dIJBA47IBnt0O1E2vKD6UbqhJdrSyg080CXEikKA,24187
23
- rara_tools/parsers/marc_parsers/base_parser.py,sha256=wzCccZaiN4p2iUms3PAOfXihNgEeg1cGRzRx26ytJeA,1661
23
+ rara_tools/parsers/marc_parsers/base_parser.py,sha256=Kdw4aivJf2FkWgIK7pJtHtVXF_G1pjHVQ7IcFItSqy8,1649
24
24
  rara_tools/parsers/marc_parsers/ems_parser.py,sha256=LFuhZcVwmHMcJknX9p4ZkO8RdjPdQZ4APGbw8KV6BIs,2024
25
25
  rara_tools/parsers/marc_parsers/location_parser.py,sha256=dSU9dQoGV5z0ajhLI1bn3AAghkOr79qKIrX7sO0_4lA,1873
26
26
  rara_tools/parsers/marc_parsers/organization_parser.py,sha256=faqQEYsut_ZF3kX1QycTnbRIqC7W8sULxmG75ICfya8,1629
@@ -29,13 +29,13 @@ rara_tools/parsers/marc_parsers/title_parser.py,sha256=uZiYb_aZWzv_xLEBSZmFt2vN6
29
29
  rara_tools/parsers/marc_records/base_record.py,sha256=05XW1oQ5fCJWxBpmBFwGVGLChGE0P605HNUdvXGiif8,4330
30
30
  rara_tools/parsers/marc_records/ems_record.py,sha256=B2YZLEeDd-GmmYqxhczbMsSEB7-x6ZLjB8OeDnzOxww,9376
31
31
  rara_tools/parsers/marc_records/organization_record.py,sha256=HmDqAqAL_Tw7ppEsS5HfogrfNuQMNChCkrdPu6K-SUE,9141
32
- rara_tools/parsers/marc_records/person_record.py,sha256=BZrXqd7hCOqm-c-sjmsOfaAI4L7lLSjIUWtxHqPjhTs,7863
33
- rara_tools/parsers/marc_records/title_record.py,sha256=uYisC25YMyOrsT6gDWyUwp0o-2nI9zOXQ62PRQmkw-A,6851
34
- rara_tools/parsers/tools/entity_normalizers.py,sha256=afOMqJoL4aeq0cfsohIuxkxzvqNdZ_ba7U32eyogbzk,8722
35
- rara_tools/parsers/tools/marc_converter.py,sha256=PUbggzJ_wHfke_bHTF2LOZyzX1t0wRM8qIFL36Dl3AI,414
32
+ rara_tools/parsers/marc_records/person_record.py,sha256=AtGESwFmN5YvrBES0BsfTgOZbroB4l0SuFRznumfmJA,7867
33
+ rara_tools/parsers/marc_records/title_record.py,sha256=XrtJ4gj7wzSaGxNaPtPuawmqqkXsVX5HAAKfXTSo4mA,6855
34
+ rara_tools/parsers/tools/entity_normalizers.py,sha256=VyCy_NowCLpOsL0luQ55IW-Qi-J5oBH0Ofzr7HRFBhM,8949
35
+ rara_tools/parsers/tools/marc_converter.py,sha256=LgSHe-7n7aiDrw2bnsB53r3fXTRFjZXTwBYfTpL0pfs,415
36
36
  rara_tools/parsers/tools/russian_transliterator.py,sha256=5ZU66iTqAhr7pmfVqXPAI_cidF43VqqmuN4d7H4_JuA,9770
37
- rara_tools-0.6.6.dist-info/licenses/LICENSE.md,sha256=hkZVnIZll7e_KNEQzeY94Y9tlzVL8iVZBTMBvDykksU,35142
38
- rara_tools-0.6.6.dist-info/METADATA,sha256=xBtPk3UH7CILIRsEiBdo-5seE2KbriRuWO2cY-6KZNM,4079
39
- rara_tools-0.6.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- rara_tools-0.6.6.dist-info/top_level.txt,sha256=JwfB5b8BAtW5OFKRln2AQ_WElTRyIBM4nO0FKN1cupY,11
41
- rara_tools-0.6.6.dist-info/RECORD,,
37
+ rara_tools-0.6.7.dist-info/licenses/LICENSE.md,sha256=hkZVnIZll7e_KNEQzeY94Y9tlzVL8iVZBTMBvDykksU,35142
38
+ rara_tools-0.6.7.dist-info/METADATA,sha256=Hc4ZQtg7mgXew0MJuJ5IjH155GYFakTKam06zMBn9yA,4079
39
+ rara_tools-0.6.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ rara_tools-0.6.7.dist-info/top_level.txt,sha256=JwfB5b8BAtW5OFKRln2AQ_WElTRyIBM4nO0FKN1cupY,11
41
+ rara_tools-0.6.7.dist-info/RECORD,,