From ef1436bca390ee916b7119036ab2d3de8d1344fb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 28 Feb 2025 12:44:55 -0600 Subject: Fix linting errors. --- scripts/pub_med.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/pub_med.py') diff --git a/scripts/pub_med.py b/scripts/pub_med.py index 82b1730..0a94355 100644 --- a/scripts/pub_med.py +++ b/scripts/pub_med.py @@ -155,8 +155,8 @@ def fetch_id_lossy_search(query, db_name, max_results): try: response = requests.get(f"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db={db_name}&retmode=json&retmax={max_results}&term={query}", - headers={"content-type": "application/json"} - ) + headers={"content-type": "application/json"}, + timeout=300) return response["esearchresult"]["idlist"] except requests.exceptions.RequestException as error: @@ -174,7 +174,7 @@ def search_pubmed_lossy(pubmed_id, db_name): - dict: Records fetched based on PubMed ID. """ url = f'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db={db_name}&id={",".join(pubmed_id)}&retmode=json' - response = requests.get(url) + response = requests.get(url, timeout=300) response.raise_for_status() data = response.json() if db_name.lower() == "pmc": -- cgit 1.4.1