def main(): article_list = helper.id_run('fetch', 'springer') parsed_df = parse_all(article_list) prop_dict = parse_properties(parsed_df) unique_id = prop_dict['id'] helper.serialize_output(unique_id, parsed_df) helper.update_id_json(prop_dict)
def main_fetch(input_db,input_term, email_id,api_key): if input_db in ('pmc','pubmed'): fetch_inst = NCBIFetch.ncbi_fetch(input_db,email_id) id_list_fetch = helper.id_run('search',input_db) doc_list = fetch_inst.pub_fetch(id_list_fetch) prop_dict = fetch_inst.search_properties() unique_id = prop_dict['id'] helper.serialize_output(unique_id,doc_list) helper.update_id_json(prop_dict) if input_db == 'springer': springer_fetch_inst = SpringerFetch.springer_fetch(input_term,api_key) url = springer_fetch_inst.ping_api() results,record_count = springer_fetch_inst.pull_results(url) prop_dict = springer_fetch_inst.search_properties(record_count) unique_id = prop_dict['id'] helper.serialize_output(unique_id,results['records']) helper.update_id_json(prop_dict)
def main(): full_doc = helper.id_run('fetch') article_list = helper.xml_to_html(full_doc, 'pmc') parsed_df = parse_all(article_list) prop_dict = parse_properties(parsed_df) unique_id = prop_dict['id'] helper.serialize_output(unique_id, parsed_df) helper.update_id_json(prop_dict)
def ncbi_search(input_term,input_db,email_id): ncbi_search_inst = NCBISearch.ncbi_search(input_term = input_term,input_db = input_db,email_id = email_id) # record_count = ncbi_search_inst.pub_count() record_count = 10 id_list_all = ncbi_search_inst.pub_search(record_count) prop_dict = ncbi_search_inst.search_properties(record_count) unique_id = prop_dict['id'] helper.serialize_output(unique_id,id_list_all) helper.update_id_json(prop_dict) # helper.clean_folder() return prop_dict
def main_search(input_term, input_db, email_id): search_inst = NCBISearch.ncbi_search(input_term, input_db, email_id) id_list = search_inst.pub_search() prop_dict = search_inst.search_properties() unique_id = prop_dict['id'] helper.serialize_output(unique_id, id_list) helper.update_id_json(prop_dict)
def ncbi_fetch(input_db,input_term, email_id): fetch_inst = NCBIFetch.ncbi_fetch(input_db,email_id) id_list_fetch = helper.id_run('search',input_db) doc_list = fetch_inst.pub_fetch(id_list_fetch) prop_dict = fetch_inst.search_properties() unique_id = prop_dict['id'] helper.serialize_output(unique_id,doc_list) helper.update_id_json(prop_dict) return(len(id_list_fetch),prop_dict)
def main_search(input_term,input_db,email_id,cur): if input_db in ('pmc','pubmed'): search_inst = NCBISearch.ncbi_search(input_term,input_db,email_id) record_count = search_inst.pub_count() id_list_all = search_inst.pub_search(record_count) id_list = helper.filter_ids(input_db,id_list_all,cur) prop_dict = search_inst.search_properties(record_count) unique_id = prop_dict['id'] helper.serialize_output(unique_id,id_list) helper.update_id_json(prop_dict)
def springer_search_fetch(input_term,api_key): springer_fetch_inst = SpringerFetch.springer_fetch(input_term,api_key) url = springer_fetch_inst.ping_api() results,record_count = springer_fetch_inst.pull_results(url) # record_count = 10 prop_dict = springer_fetch_inst.search_properties(record_count) unique_id = prop_dict['id'] helper.serialize_output(unique_id,results['records']) helper.update_id_json(prop_dict) return(record_count,prop_dict)