Registry / database / eutils

eutils

JSON →
library0.6.1pypypi✓ verified 90d ago

Python interface to NCBI's E-utilities API (Entrez Programming Utilities). Current version 0.6.1, requires Python >=3.12. Supports searching, fetching, and linking NCBI databases (PubMed, Nucleotide, etc.). Release cadence is irregular.

pip install eutils
INSTALL
IMPORT
SIG · EUTILS
E
eutils
databasepythonv0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
✓ from eutils import Client
Query
✓ from eutils import Query

Create a Client with email (required) and optional NCBI API key for higher rate limits, then search PubMed.

from eutils import Client # Use email to comply with NCBI's usage policy (required by eutils) client = Client(email='your_email@example.com', api_key=os.environ.get('NCBI_API_KEY', '')) result = client.esearch(db='pubmed', term='cancer', retmax=5) print(result)
Debug
Known issues
breakingeutils 0.6.x drops support for Python <3.12. Users on older Python versions must stay on 0.5.x or upgrade Python.
fix
Upgrade Python to 3.12+ or pin to eutils==0.5.4.
affects: >=0.6.0
gotchaNCBI requires an email address and, for high-volume access, an API key. eutils will warn if email is missing, and may block requests without proper identification.
fix
Always provide an email when creating a Client. For higher rate limits, register for an NCBI API key and pass it via `api_key` parameter.
affects: all
gotchaThe `efetch` method returns raw XML strings by default, not parsed objects. Users often expect Python objects and are surprised by the string output.
fix
Parse XML manually or use `eutils.xml_parser` helpers if available. Alternatively, use `eutils.xml_parser.parse_efetch_xml()` to get structured data.
affects: all
Errors
Common errors & fixes
EClientWarning: Email not provided. Please provide an email address.
Creating a Client without the `email` parameter. NCBI policy requires an email address.
fix
Initialize Client with email: `Client(email='your.email@example.com')`.
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests
Exceeding NCBI's rate limit (3 requests/second without API key, 10 requests/second with API key).
fix
Add a delay between requests or obtain an NCBI API key and pass it to Client: `Client(api_key='your_key')`.
AttributeError: 'str' object has no attribute 'find' (when trying to parse efetch result)
Assuming `efetch` returns parsed data, but it returns raw XML string by default.
fix
Parse the XML string: `import xml.etree.ElementTree as ET; root = ET.fromstring(raw_xml)`.
Upgrade
Version history
0.6.1latest on PyPI · released Dec 7, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Resources
eutils — pip install eutils · libregistry