Closed nils-herrmann closed 1 month ago
There is a minor bug in the PR #141 when parsing the year. There are documents without ppub and collection which means that pub_date_dict["year"] is empty.
year
ppub
collection
pub_date_dict["year"]
Example with PMC6218202
parse_pubmed_xml(path_to_ PMC6218202, nxml=True)
Trows:
[197] try: --> [198] pub_year = int(pub_date_dict["year"]) [199] except TypeError: [200] pub_year = None KeyError: 'year'
Let's just use .get()
.get()
There is a minor bug in the PR #141 when parsing the
year
. There are documents withoutppub
andcollection
which means thatpub_date_dict["year"]
is empty.Example with PMC6218202
Trows:
Let's just use
.get()