Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/paperqa/clients/unpaywall.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
from datetime import datetime
from http import HTTPStatus
from typing import Literal
from urllib.parse import quote

import aiohttp
Expand Down Expand Up @@ -30,11 +31,11 @@ class Author(BaseModel):
class BestOaLocation(BaseModel):
model_config = ConfigDict(extra="allow")

updated: datetime | None = None
updated: datetime | Literal["deprecated"] | None = None
url: str | None = None
url_for_pdf: str | None = None
url_for_landing_page: str | None = None
evidence: str | None = None
evidence: str | Literal["deprecated"] | None = None # noqa: PYI051
license: str | None = None
version: str | None = None
host_type: str | None = None
Expand Down
497 changes: 284 additions & 213 deletions tests/cassettes/test_doi_search[paper_attributes0].yaml

Large diffs are not rendered by default.

371 changes: 257 additions & 114 deletions tests/cassettes/test_doi_search[paper_attributes1].yaml

Large diffs are not rendered by default.

167 changes: 76 additions & 91 deletions tests/cassettes/test_doi_search[paper_attributes2].yaml

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions tests/cassettes/test_doi_search[paper_attributes3].yaml

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions tests/cassettes/test_doi_search[paper_attributes4].yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions tests/test_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ async def test_title_search(paper_attributes: dict[str, str]) -> None:
" editing"
),
"source": ["semantic_scholar", "crossref"],
"key": "herger2024highthroughputscreeningof",
"doi": "10.1101/2024.04.01.587366",
"doc_id": "8e7669b50f31c52b",
"journal": "BioRxiv",
"key": "herger2025highthroughputscreeningof",
"doi": "10.1016/j.xgen.2025.100814",
"doc_id": "17ba73198ea7230c", # spellchecker: disable-line
"journal": "Cell Genomics",
"authors": [
"Michael Herger",
"Christina M. Kajba",
Expand All @@ -170,9 +170,10 @@ async def test_title_search(paper_attributes: dict[str, str]) -> None:
"formatted_citation": (
"Michael Herger, Christina M. Kajba, Megan Buckley, Ana Cunha, Molly"
" Strom, and Gregory M. Findlay. High-throughput screening of human"
" genetic variants by pooled prime editing. BioRxiv, Apr 2024. URL:"
" https://doi.org/10.1101/2024.04.01.587366,"
" doi:10.1101/2024.04.01.587366. This article has 1 citations."
" genetic variants by pooled prime editing. Cell Genomics, 5:100814, Apr 2025. URL:"
" https://doi.org/10.1016/j.xgen.2025.100814,"
" doi:10.1016/j.xgen.2025.100814."
" This article has 5 citations and is from a peer-reviewed journal."
),
"is_oa": True,
},
Expand Down