Esempio n. 1
0
 def setUp(self):
     pubmed.connect('MYTOOl', '*****@*****.**')
     self.term = "science[journal] AND breast cancer AND 2008[pdat]"
     self.results_list = [
         '19008416', '18927361', '18787170', '18487186', '18239126',
         '18239125'
     ]
Esempio n. 2
0
 def setUp(self):
     pubmed.connect('MYTOOl', '*****@*****.**')
     self.ids = [
         '19008416', '18927361', '18787170', '18487186', '18239126',
         '18239125'
     ]
Esempio n. 3
0
 def test_connection(self):
     pubmed.connect('MYTOOl', '*****@*****.**')
     assert pubmed.settings.tool == 'MYTOOl'
     assert pubmed.settings.email == '*****@*****.**'
Esempio n. 4
0
#!/usr/bin/env python

'''
This script performs a PubMed search and returns a list of article IDs.
'''

from litter_getter import pubmed

pubmed.connect("PUBMED", '*****@*****.**')

#search_term = """science[journal] AND sorghum AND 2018[pdat]"""
search_term = """science[journal] AND breast cancer AND 2008[pdat]"""
search = pubmed.PubMedSearch(term=search_term)

search.get_ids_count()

print("ID count: {0}".format(search.id_count))

id_list = search.get_ids()

print("IDs: {0}".format(id_list))
Esempio n. 5
0
 def ready(self):
     from . import signals  # noqa
     from litter_getter import pubmed
     pubmed.connect(settings.PUBMED_TOOL, settings.PUBMED_EMAIL)
Esempio n. 6
0
from litter_getter import pubmed
# import xml.dom.minidom
import xml.etree.ElementTree as ET

# register with user account
pubmed.connect('4310661ddba8abf80e4be5c7c0850ae71d09')


def getMetaData(papersToFind):

    ids = []
    for paper in papersToFind:
        ids.append(paper.s.pubmed_id)

    fetch = pubmed.PubMedFetch(id_list=ids)
    refs = fetch.get_content()

    for num, id in enumerate(refs):
        papersToFind[num].s.abstract = refs[num]['abstract']
        papersToFind[num].s.paper_authors = ', '.join(refs[num]['authors'])
        papersToFind[num].s.title = refs[num]['title']
        papersToFind[
            num].s.source_url = "https://www.ncbi.nlm.nih.gov/pubmed/" + papersToFind[
                num].s.pubmed_id
        papersToFind[num].s.doi = refs[num]['doi']
        papersToFind[num].s.abstract = refs[num]['abstract']

        root = ET.fromstring(refs[num]["xml"])
        if root[0].find('Article'):
            if root[0].find('Article').find('Journal'):
                papersToFind[num].s.journal = root[0].find('Article').find(
Esempio n. 7
0
    def ready(self):
        from . import signals  # noqa
        from litter_getter import pubmed

        if settings.PUBMED_API_KEY:
            pubmed.connect(settings.PUBMED_API_KEY)