Skip to content

Instantly share code, notes, and snippets.

View mirekys's full-sized avatar

Miroslav Bauer mirekys

View GitHub Profile
@mirekys
mirekys / doi_resolver.py
Last active May 19, 2022 13:31
Resolves a DOI identifier and returns record metadata in JSON format
#!/usr/bin/env python3
# pip install crossrefapi
from crossref.restful import Works
import requests
"""
Simple client for CrossRef DOI content negotiation
Tries to resolve a given DOI with CrossRef API.
If it fails (e.g. DOI is not minted by the CrossRef agency),
#!/usr/bin/env python3
# pip install bagit
import os
import bagit
import shutil
def export_bagit(record_metadata, attachments):
pwd = os.getcwd()
dir = pwd + "/files_to_bag"