DOI API for Python - Crossref Commons

Q

What is DOI API for Python - Crossref Commons?

✍: FYIcenter.com

A

"Crossref Commons" is a Python library that offers a DOI API for you to access the DOI database.

"Crossref Commons" offers 5 main DOI API functionalities:

1. Retrieving entities with the "retrieval" module.

import crossref_commons.retrieval

crossref_commons.retrieval.get_publication_as_json('10.5621/sciefictstud.40.2.0382')
crossref_commons.retrieval.get_publication_as_xml('10.5621/sciefictstud.40.2.0382')
crossref_commons.retrieval.get_publication_as_refstring('10.5621/sciefictstud.40.2.0382', 'ieee')

crossref_commons.retrieval.get_member_as_json('15')

2. Retrieving entities with the "get_entity" module.

from crossref_commons.retrieval import get_entity
from crossref_commons.types import EntityType, OutputType

get_entity('10.5621/sciefictstud.40.2.0382', EntityType.PUBLICATION, OutputType.JSON)
get_entity('10.5621/sciefictstud.40.2.0382', EntityType.PUBLICATION, OutputType.XML)
get_entity('10.5621/sciefictstud.40.2.0382', EntityType.PUBLICATION, OutputType.REFSTRING, 'ieee')

get_entity('15', EntityType.MEMBER, OutputType.JSON)

3. Retrieving relations.

from crossref_commons.relations import get_related

get_related('10.1167/18.8.6')

4. Iterating.

from crossref_commons.iteration import iterate_publications_as_json

filter = {'funder': '10.13039/501100000038', 'type': 'journal-article'}
queries = {'query.author': 'li', 'query.affiliation': 'university'}
for p in iterate_publications_as_json(max_results=189, filter=filter, queries=queries):
  print(p['DOI'])

5. Sampling.

from crossref_commons.sampling import get_sample

filter = {'funder': '10.13039/501100000038', 'type': 'journal-article'}
queries = {'query.author': 'li', 'query.affiliation': 'university'}
sample = get_sample(size=121, filter=filter, queries=queries)

For more information, visit https://gitlab.com/crossref/crossref_commons_py.

 

XML API - doi.crossref.org/servlet/query?id={doi}

crossref.org API - /works Updates

Crossref.org DOI Database

⇑⇑ DOI - Frequently Asked Questions

2022-12-21, 694👍, 1💬