Skip to content

Commit

Permalink
update organization name words
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Feb 20, 2025
1 parent 2d6d3d7 commit 742dd6d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion commonmeta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

__title__ = "commonmeta-py"
__version__ = "0.80"
__version__ = "0.81"
__author__ = "Martin Fenner"
__license__ = "MIT"

Expand Down
1 change: 1 addition & 0 deletions commonmeta/author_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def is_personal_name(name):
"Reviewers",
"Staff",
"Lab",
"Redkation",
]
):
return False
Expand Down
44 changes: 22 additions & 22 deletions commonmeta/readers/schema_org_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ def get_schema_org(pid: str, **kwargs) -> dict:
return {"@id": url, "@type": "WebPage", "state": state, "via": "schema_org"}
elif response.headers.get("content-type") == "application/pdf":
try:
pdf = pikepdf.Pdf.open(io.BytesIO(response.content))
meta = pdf.docinfo if pdf.docinfo else {}
if meta.get("/doi", None) is not None:
return get_doi_meta(meta.get("/doi"))
date_modified = (
get_datetime_from_pdf_time(meta.get("/ModDate"))
if meta.get("/ModDate", None)
else None
)
name = meta.get("/Title", None)
return compact(
{
"@id": url,
"@type": "DigitalDocument",
"via": "schema_org",
"name": str(name),
"datePublished": date_modified,
"dateAccessed": datetime.now().isoformat("T", "seconds")
if date_modified is None
else None,
}
)
pdf = pikepdf.open(io.BytesIO(response.content))
with pdf.open_metadata() as meta:
if meta.get("/doi", None) is not None:
return get_doi_meta(meta.get("/doi"))
date_modified = (
get_datetime_from_pdf_time(meta.get("/ModDate"))
if meta.get("/ModDate", None)
else None
)
name = meta.get("/Title", None)
return compact(
{
"@id": url,
"@type": "DigitalDocument",
"via": "schema_org",
"name": str(name),
"datePublished": date_modified,
"dateAccessed": datetime.now().isoformat("T", "seconds")
if date_modified is None
else None,
}
)
except Exception as error:
print(error)
return {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "commonmeta-py"
version = "0.80"
version = "0.81"
description = "Library for conversions to/from the Commonmeta scholarly metadata format"
authors = [{ name = "Martin Fenner", email = "[email protected]" }]
requires-python = ">=3.9,<4.0"
Expand Down

0 comments on commit 742dd6d

Please sign in to comment.