def get_affiliation(affl_id): logger.info(f'Retrieving affiliation {affl_id}') api_key = key_manager.get_key('affiliation') client = elsclient.ElsClient(api_key) affl = ElsAffil(affil_id=affl_id) if not affl.read(client): logger.error("[!]Read affiliation failed: %s", affl_id) affl.data['_id'] = affl.data['coredata']['dc:identifier'].split(':')[1] yield affl.data
def readElsevierAffiliation(self, affilID='60101411'): ## Affiliation example # Initialize affiliation with ID as string my_aff = ElsAffil(affil_id=affilID) if my_aff.read(self, self.client): print("my_aff.name: ", my_aff.name) my_aff.write() else: print("Read affiliation failed.")
## Author example # Initialize author with uri my_auth = ElsAuthor( uri = 'https://api.elsevier.com/content/author/author_id/7004367821') # Read author data, then write to disk if my_auth.read(client): print ("my_auth.full_name: ", my_auth.full_name) my_auth.write() else: print ("Read author failed.") ## Affiliation example # Initialize affiliation with ID as string my_aff = ElsAffil(affil_id = '60101411') if my_aff.read(client): print ("my_aff.name: ", my_aff.name) my_aff.write() else: print ("Read affiliation failed.") ## Scopus (Abtract) document example # Initialize document with ID as integer scp_doc = AbsDoc(scp_id = 84872135457) if scp_doc.read(client): print ("scp_doc.title: ", scp_doc.title) scp_doc.write() else: print ("Read document failed.") ## ScienceDirect (full-text) document example using PII