FAIR signposting
The signposting client (bibliofabric.signposting) reads the signposting of
a scholarly object: the typed links (cite-as, author, describedby,
describes, license, item, collection, type) that a landing page
serves in its HTTP Link header, following the conventions on
signposting.org. It is a resolver,
not a catalog: you give it a landing page URL or a DOI, and it answers one
typed result. Every async method has a generated sync twin with the same
API.
Credentials
Landing pages and the DOI proxy need no credentials. The client paces
itself at 2 requests per second. Tunables such as SIGNPOSTING_TIMEOUT and
SIGNPOSTING_MAX_RETRIES are described in
Settings. Install bibliofabric as described in
Setup.
No base URL of its own
The client has no base URL of its own: every landing page URL arrives with
the call. The one fixed host is the DOI System proxy at https://doi.org,
which resolve_doi uses to turn a DOI into a landing page URL. The
settings class carries no base URL field, following bibliofabric.doi;
the constant lives in the dialect module, and a base_url= constructor
argument overrides it for tests.
Quick start
import asyncio
from bibliofabric.signposting import SignpostingClient
async def main() -> None:
async with SignpostingClient() as client:
result = await client.resolve_doi("10.34894/SRSB8I")
print(result.url, result.status)
print("cite-as:", [link.href for link in result.cite_as])
print("items:", [(link.href, link.media_type) for link in result.items])
print("license:", [link.href for link in result.licenses])
print("metadata formats:", [link.media_type for link in result.describedby])
if result.linkset is not None:
for group in result.linkset.groups:
print("linkset group:", group.anchor, len(group.links), "links")
asyncio.run(main())
https://dataverse.nl/dataset.xhtml?persistentId=doi:10.34894/SRSB8I 200
cite-as: ['https://doi.org/10.34894/SRSB8I']
items: [('https://dataverse.nl/api/access/datafile/192733', 'application/x-spss-sav'), ('https://dataverse.nl/api/access/datafile/192732', 'application/pdf')]
license: ['http://creativecommons.org/publicdomain/zero/1.0']
metadata formats: ['application/vnd.citationstyles.csl+json', 'application/json', 'application/xml', 'application/xml', 'application/xml', 'application/ld+json', 'application/xml', 'application/json', 'application/xml', 'text/html', 'application/json', 'application/json', 'application/xml']
linkset group: https://dataverse.nl/dataset.xhtml?persistentId=doi:10.34894/SRSB8I 19 links
resolve() does the same for a landing page URL you already have:
result = await client.resolve("https://zenodo.org/records/1238808")
What the result carries
A SignpostingResult holds the landing page URL, the HTTP status, every
parsed link in order, and the plain rel-to-URL mapping of the core
parse_link_header helper (the first entry of each relation type). The
relation properties (cite_as, authors, describedby, describes,
licenses, items, collections, types, linkset_links) return lists,
because a landing page can serve several links per relation. When the
landing page advertises a linkset link, the client fetches the link set
document and parses it into result.linkset, a group per anchor, decoded
from the JSON serialization or from the application/linkset text
serialization of RFC 9264.
See Upstream quirks for the server behaviors the client tolerates, and the API reference for every method and model.