def doi_to_data(doi_string: str) -> Dict[str, Any]: """Search through crossref and get a dictionary containing the data :param doi_string: Doi identificator or an url with some doi :type doi_string: str :returns: Dictionary containing the data :raises ValueError: If no data could be retrieved for the doi """ doi_string = doi.get_clean_doi(doi_string) results = get_data(dois=[doi_string]) if results: return results[0] raise ValueError("Couldn't get data for doi ({})".format(doi_string))
def doi_to_data(doi_string): """Search through crossref and get a dictionary containing the data :param doi_string: Doi identificator or an url with some doi :type doi_string: str :return:: Dictionary containing the data :raises ValueError: If no data could be retrieved for the doi """ global logger assert(isinstance(doi_string, str)) doi_string = doi.get_clean_doi(doi_string) results = get_data(dois=[doi_string]) if results: return results[0] else: raise ValueError( "Couldn't get data for doi ({doi})".format(doi=doi_string) )