Skip to content

Commit

Permalink
Jats page count bugfix (#80)
Browse files Browse the repository at this point in the history
* jats page count bugfix

* exception handling for page counts

---------

Co-authored-by: Mugdha Polimera <mugdhapolimera@saos-MacBook-Pro.local>
  • Loading branch information
mugdhapolimera and Mugdha Polimera committed Dec 6, 2023
1 parent 9d806ea commit b18e28a
Show file tree
Hide file tree
Showing 4 changed files with 721 additions and 3 deletions.
7 changes: 4 additions & 3 deletions adsingestp/parsers/jats.py
Expand Up @@ -889,9 +889,10 @@ def _parse_page(self):
if self.article_meta.find("counts") and self.article_meta.find("counts").find(
"page-count"
):
self.base_metadata["numpages"] = (
self.article_meta.find("counts").find("page-count").get("count", "")
)
if str(self.article_meta.find("counts").find("page-count").get("count", "")).isdigit():
self.base_metadata["numpages"] = (
self.article_meta.find("counts").find("page-count").get("count", "")
)

def _parse_references(self):
if self.back_meta is not None:
Expand Down

0 comments on commit b18e28a

Please sign in to comment.