def ieee_author_search_parser(author_name): """ Method to parse the list of publications and their authors from IEEE website into an array object, given the name of the author """ out_file = "data/ieee_author_search.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_author_search(author_name, kind="xml").encode("utf-8") fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publications = [] for child1 in root_element: if child1.tag == "document": title = None authors = [] publication = {} for child2 in child1: if child2.tag == "title": title = child2.text elif child2.tag == "authors": authors = IEEE_Parser.format_names_list(child2.text) if title is not None: publication["title"] = title publication["authors"] = authors publications.append(publication) return publications
def ieee_author_search_parser(author_name): """ Method to parse the list of publications and their authors from IEEE website into an array object, given the name of the author """ out_file = "data/ieee_author_search.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_author_search(author_name, kind="xml").encode('utf-8') fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publications = [] for child1 in root_element: if (child1.tag == 'document'): title = None authors = [] publication = {} for child2 in child1: if (child2.tag == 'title'): title = child2.text elif (child2.tag == 'authors'): authors = IEEE_Parser.format_names_list(child2.text) if title is not None: publication['title'] = title publication['authors'] = authors publications.append(publication) return publications
def ieee_publication_search_parser(publication_name): """ Method to parse the publication details from IEEE website into an array object, given the name of the publication """ out_file = "data/ieee_publication_search.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_publication_search(publication_name, kind="xml").encode('utf-8') fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publications = [] for child1 in root_element: if (child1.tag == 'document'): publication = {} for child2 in child1: if (child2.tag == 'rank'): publication['rank'] = child2.text elif (child2.tag == 'title'): publication['title'] = child2.text elif (child2.tag == 'authors'): publication['authors'] = IEEE_Parser.format_names_list( child2.text) elif (child2.tag == 'pubtitle'): publication['pubtitle'] = child2.text elif (child2.tag == 'punumber'): publication['pubnumber'] = child2.text elif (child2.tag == 'pubtype'): publication['pubtype'] = child2.text elif (child2.tag == 'publisher'): publication['publisher'] = child2.text elif (child2.tag == 'py'): publication['pubyear'] = child2.text elif (child2.tag == 'isbn'): publication['isbn'] = child2.text elif (child2.tag == 'arnumber'): publication['arnumber'] = child2.text elif (child2.tag == 'doi'): publication['doi'] = child2.text elif (child2.tag == 'publicationId'): publication['publicationId'] = child2.text if 'doi' not in publication: publication['doi'] = '' publications.append(publication) return publications
def ieee_publication_search_parser(publication_name): """ Method to parse the publication details from IEEE website into an array object, given the name of the publication """ out_file = "data/ieee_publication_search.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_publication_search(publication_name, kind="xml").encode("utf-8") fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publications = [] for child1 in root_element: if child1.tag == "document": publication = {} for child2 in child1: if child2.tag == "rank": publication["rank"] = child2.text elif child2.tag == "title": publication["title"] = child2.text elif child2.tag == "authors": publication["authors"] = IEEE_Parser.format_names_list(child2.text) elif child2.tag == "pubtitle": publication["pubtitle"] = child2.text elif child2.tag == "punumber": publication["pubnumber"] = child2.text elif child2.tag == "pubtype": publication["pubtype"] = child2.text elif child2.tag == "publisher": publication["publisher"] = child2.text elif child2.tag == "py": publication["pubyear"] = child2.text elif child2.tag == "isbn": publication["isbn"] = child2.text elif child2.tag == "arnumber": publication["arnumber"] = child2.text elif child2.tag == "doi": publication["doi"] = child2.text elif child2.tag == "publicationId": publication["publicationId"] = child2.text if "doi" not in publication: publication["doi"] = "" publications.append(publication) return publications
def ieee_doi_get_parser(doi_number): """ Method to parse the publication details from IEEE website into a dictionary object, given the DOI number """ out_file = "data/ieee_doi_get.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_doi_get(doi_number, kind="xml").encode('utf-8') fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publication = {} for child1 in root_element: if (child1.tag == 'document'): for child2 in child1: if (child2.tag == 'rank'): publication['rank'] = child2.text elif (child2.tag == 'title'): publication['title'] = child2.text elif (child2.tag == 'authors'): publication['authors'] = IEEE_Parser.format_names_list( child2.text) elif (child2.tag == 'pubtitle'): publication['pubtitle'] = child2.text elif (child2.tag == 'punumber'): publication['pubnumber'] = child2.text elif (child2.tag == 'pubtype'): publication['pubtype'] = child2.text elif (child2.tag == 'publisher'): publication['publisher'] = child2.text elif (child2.tag == 'py'): publication['pubyear'] = child2.text elif (child2.tag == 'isbn'): publication['isbn'] = child2.text elif (child2.tag == 'arnumber'): publication['arnumber'] = child2.text elif (child2.tag == 'doi'): publication['doi'] = child2.text elif (child2.tag == 'publicationId'): publication['publicationId'] = child2.text return publication
def ieee_doi_get_parser(doi_number): """ Method to parse the publication details from IEEE website into a dictionary object, given the DOI number """ out_file = "data/ieee_doi_get.xml" fout = open(out_file, "w") print >> fout, IEEE.ieee_doi_get(doi_number, kind="xml").encode("utf-8") fout.close() tree = ET.parse(out_file) root_element = tree.getroot() publication = {} for child1 in root_element: if child1.tag == "document": for child2 in child1: if child2.tag == "rank": publication["rank"] = child2.text elif child2.tag == "title": publication["title"] = child2.text elif child2.tag == "authors": publication["authors"] = IEEE_Parser.format_names_list(child2.text) elif child2.tag == "pubtitle": publication["pubtitle"] = child2.text elif child2.tag == "punumber": publication["pubnumber"] = child2.text elif child2.tag == "pubtype": publication["pubtype"] = child2.text elif child2.tag == "publisher": publication["publisher"] = child2.text elif child2.tag == "py": publication["pubyear"] = child2.text elif child2.tag == "isbn": publication["isbn"] = child2.text elif child2.tag == "arnumber": publication["arnumber"] = child2.text elif child2.tag == "doi": publication["doi"] = child2.text elif child2.tag == "publicationId": publication["publicationId"] = child2.text return publication
from lookup.IEEE import IEEE import json fout = open("ieee_publication_details.txt", "w") def banner(msg): print >> fout, 70 * "=" print >> fout, msg print >> fout, 70 * "=" publication = 'Abstract Image Management and Universal Image Registration for Cloud and HPC Infrastructures' banner("ieee author details xml") print >> fout, IEEE.ieee_publication_search(publication, kind="xml").encode('utf-8') banner("ieee author details json") print >> fout, json.dumps(IEEE.ieee_publication_search(publication, kind="json"), indent=2).encode('utf-8')
from lookup.IEEE import IEEE import json fout = open("ieee_publication_details.txt", "w") def banner(msg): print >> fout, 70 * "=" print >> fout, msg print >> fout, 70 * "=" publication = "Abstract Image Management and Universal Image Registration for Cloud and HPC Infrastructures" banner("ieee author details xml") print >> fout, IEEE.ieee_publication_search(publication, kind="xml").encode("utf-8") banner("ieee author details json") print >> fout, json.dumps(IEEE.ieee_publication_search(publication, kind="json"), indent=2).encode("utf-8")
def banner(msg): print 70 * "=" print msg print 70 * "=" banner("doi turtle") print DOI.doi_get("10.1109/GCE.2010.5676126", kind="turle") banner("doi bibtex") print DOI.doi_get("10.1109/GCE.2010.5676126") banner("doi json") pprint(DOI.doi_get("10.1109/GCE.2010.5676126", kind="json")) banner("ieee xml") print IEEE.ieee_doi_get("10.1109/GCE.2010.5676126", kind="xml") banner("ieee json") print IEEE.ieee_doi_get("10.1109/GCE.2010.5676126", kind="json") banner("orcid xml") print ORCID.orcid_doi_get("10.1109/GCE.2010.5676126", kind="xml") banner("orcid json") print json.dumps(ORCID.orcid_doi_get("10.1109/GCE.2010.5676126", kind="json"), indent=2) banner("crossref json") pprint(CrossRef.crossref_doi_get("10.1109/GCE.2010.5676126", kind="json"))
from lookup.IEEE import IEEE import json fout = open("ieee_author_details.txt", "w") def banner(msg): print >> fout, 70 * "=" print >> fout, msg print >> fout, 70 * "=" author = 'Gregor von Laszewski' banner("ieee author details xml") print >> fout, IEEE.ieee_author_search(author, kind="xml").encode('utf-8') banner("ieee author details json") print >> fout, json.dumps(IEEE.ieee_author_search(author, kind="json"), indent=2).encode('utf-8')