backend.crossref module

class backend.crossref.CrossRefAPI[source]

Bases: object

Fetches papers from CrossRef


Fetches the metadata with content-negotiation to create the paper.

Returns:a Paper object or None if there was an error
save_doi_metadata(metadata, extra_orcids=None)[source]

Given the metadata as Citeproc+JSON or from CrossRef, create the associated paper and publication

Parameters:extra_orcids – an optional orcids list, which will be unified with the orcids extracted from the metadata. This is useful for the ORCID interface.
Returns:the paper, created if needed
search_for_dois_incrementally(query, filters=None, max_batches=10)[source]

Searches for DOIs for the given query and yields their metadata as it finds them.

  • query – the search query to pass to CrossRef
  • filters – filters as specified by the REST API (as a dictionary)
  • max_batches – maximum number of queries to send to CrossRef

Fetches the abstract from Zotero and adds it to the publication if it succeeds.


Converts a dictionary {‘family’:’Last’,’given’:’First’} to (‘First’,’Last’)

backend.crossref.create_publication(paper, metadata)[source]

Creates a BareOaiRecord entry based on the DOI metadata (as returned by the JSON format from CrossRef).

  • paper – the paper the publication object refers to
  • metadata – the CrossRef metadata (parsed from JSON)

None if the metadata is invalid or the data does not fit in the database schema, otherwise the pair of the paper and the publication.


Fetch the metadata of a list of DOIs from CrossRef, by batch if the server supports it, otherwise incrementally.


Fetch a list of DOIs by batch (useful when refreshing the list of publications of a given researcher, as the records have most likely been already cached before by the proxy)


Fetch a list of DOIs incrementally (useful when the proxy only supports this method or when we want to return the first metadata as soon as possible)


Fetch the metadata for a single DOI. This is supported by the standard proxy,, as well as more advanced proxies such as doi_cache


Fetch Zotero metadata for a given DOI. Works only with the doi_cache proxy.


Get the publication date out of a record. If ‘issued’ is not present we default to ‘deposited’ although this might be quite inaccurate. But this case is rare anyway.


This function returns whether we expect a publication under a given license to be freely available from the publisher.

Licenses are as expressed in CrossRef: see


Parse the date representation from CrossRef to a python object