Commit 233e3f39 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'provide-email-to-eutils' into 'master'

provide email as recommended by Bioservice

See merge request !37
parents b82060f1 96e2613d
Pipeline #77935 passed with stages
in 46 minutes and 57 seconds
......@@ -9,6 +9,7 @@ import requests
from bioservices.eutils import EUtils
from bioservices.uniprot import UniProt
from bs4 import BeautifulSoup
from django.conf import settings
from requests.exceptions import ContentDecodingError
from chembl_webresource_client.new_client import new_client
......@@ -81,7 +82,7 @@ def get_pubmed_info(pmid: int) -> dict:
:return: publication metadata (title, journal name, publication year, authors list).
:rtype: dict
"""
eu = EUtils()
eu = EUtils(email=settings.EUTILS_EMAIL)
r = eu.EFetch("pubmed", pmid, retmode="dict", rettype="abstract")
if isinstance(r, int):
raise PubMedEntryNotFound(pmid, r)
......@@ -331,7 +332,7 @@ def get_taxonomy_info(taxonomy_id: str) -> dict:
:return: Taxon metadata (scientific name).
:rtype: dict
"""
eu = EUtils()
eu = EUtils(email=settings.EUTILS_EMAIL)
r = eu.EFetch("taxonomy", taxonomy_id, retmode="dict")
scientific_name = r["TaxaSet"]["Taxon"]["ScientificName"]
return {"scientific_name": scientific_name}
......
......@@ -229,6 +229,9 @@ LABLINKS_RESOURCE_DESCRIPTION = (
)
LABLINKS_CONTACT_EMAIL = "ippidb@pasteur.fr"
# BioServices settings
EUTILS_EMAIL = "ippidb@pasteur.fr"
# MAINTENANCE SETTINGS
# if True the maintenance-mode will be activated
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment