A Python script that fetches publication metadata from CrossRef API for a list of DOIs and exports the data to CSV.
- Python 3.6+
requestslibrary:pip install requests
-
Have a DOI list in CSV - You can either use the CSV results from SCOAP3's
year_exportor make your own CSV file with this format, all that matters is that you have a column nameddoiand you name the filedois.csv(or change the input file name):doi 10.1103/xgkt-1qsb 10.1103/bm4l-4mmv 10.1103/xgkt-1qsb ... -
Place
dois.csvin the same directory ascrossref_script.py -
Run the script:
python crossref_script.py
-
Get your results - The script creates
output.csvwith the analyzed data.
Edit the field_analysis dictionary in the script:
field_analysis = {
"title": "y/n", # Check if title exists
"author.given": "nr", # Count author given names
"page": "data", # Get actual page numbers
...
}"y/n"- Returns "y" if field exists, "n" if not"nr"- Counts how many times field appears"data"- Returns the actual field values
Edit these lines in the script:
input_file = "dois.csv" # Your DOI list
write_to_csv(dois, field_analysis, "output.csv") # Your output file