xDD client

This modules provides an interface to query xDD content for figures and tables.

emmaa.xdd.xdd_client.get_document_figures(paper_id, paper_id_type)[source]

Get figures and tables from a given paper.

Parameters:
  • paper_id (str or int) – ID of a paper.
  • paper_id_type (str) – A name of a paper ID type (PMID, PMCID, DOI, TRID).
Returns:

figures – A list of tuples where each tuple is a figure title and bytes content.

Return type:

list[tuple]

emmaa.xdd.xdd_client.get_document_objects(doi)[source]

Get a list of figure/table object dictionaries for a given DOI.

emmaa.xdd.xdd_client.get_figures_from_objects(objects, paper_links=False)[source]

Get a list of paper links, figure titles and their content bytes from a list of object dictionaries (returned from query or document api).

emmaa.xdd.xdd_client.get_figures_from_query(query, limit=None)[source]

Get figures and tables from a query.

Parameters:
  • query (str) – An entity name or comma-separated entity names to query for.
  • limit (int or None) – A number of figures and tables to return.
Returns:

figures – A list of tuples where each tuple is a link to the paper, a figure title and bytes content.

Return type:

list[tuple]

emmaa.xdd.xdd_client.send_document_search_request(doi, page)[source]

Send a request to get one page of results for a DOI.

emmaa.xdd.xdd_client.send_query_search_request(query, page)[source]

Send a request to get one page of results for a query.

emmaa.xdd.xdd_client.send_request(url, params)[source]

Send a request and handle potential errors.