unpaywall
zocrates.discovery.providers.unpaywall ¶
Unpaywall legal Open Access PDF URL resolver.
UnpaywallResolver ¶
Resolves open-access fulltext PDF URLs via the Unpaywall API.
Initialize the Unpaywall resolver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
email
|
str
|
Contact email used for polite-pool API requests. |
DEFAULT_POLITE_EMAIL
|
timeout
|
float
|
HTTP request timeout in seconds. |
5.0
|
Source code in zocrates/discovery/providers/unpaywall.py
resolve_pdf
async
¶
Query Unpaywall for a legal, direct Open Access PDF URL for the given DOI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
str
|
Digital Object Identifier (canonical or raw). |
required |
email
|
str | None
|
User or developer email for polite pool identification. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Direct PDF URL string if available and verified, or None. |
Source code in zocrates/discovery/providers/unpaywall.py
make_user_agent ¶
Build a respectful User-Agent header string adhering to API etiquette.
Source code in zocrates/discovery/providers/base.py
normalize_doi ¶
Normalize DOI by stripping standard URI and resolver prefixes and lowercasing.