Skip to main content

Python REST API for Entrez E-Utilities: stateless, easy to use, reliable.

Project description

tests Documentation Status

Python REST API for Entrez E-Utilities, aiming to be easy to use and reliable.

Previously published entrezpy implements stateful API extensions (queries with history) which is error-prone and led me (and others) to obtain misleading results.

This implementation:

  • avoids the problem altogether by not using such stateful API,

  • makes common tasks easy thanks to simple Pythonic API,

  • is typed and integrates well with mypy,

  • tested on Windows, Mac and Linux across Python 3.6, 3.7, and 3.8,

  • is limited in scope, allowing to focus on the reliability of the core code.

Stats: beta (pending tutorial write-up and documentation improvements before official release).

from easy_entrez import EntrezAPI

entrez_api = EntrezAPI(
    'your-tool-name',
    'e@mail.com',
    # optional
    return_type='json'
)

# find up to 10 000 results for cancer in human
result = entrez_api.search('cancer AND human[organism]', max_results=10_000)

# data will be populated with JSON or XML (depending on the `return_type` value)
result.data

See more in the Demo notebook and documentation.

Installation

Requires Python 3.6+. Install with:

pip install easy-entrez

If you wish to enable (optional, tqdm-based) progress bars use:

pip install easy-entrez[with_progress_bars]

Alternatives:

You might want to try:

  • biopython.Entrez - biopython is a heavy dependency, but probably good choice if you already use it

  • pubmedpy - provides interesting utilities for parsing the responses

  • entrez - appears to have a comparable scope but quite different API

I have tried and do not recommend:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_entrez-0.2.2.tar.gz (12.9 kB view details)

Uploaded Source

File details

Details for the file easy_entrez-0.2.2.tar.gz.

File metadata

  • Download URL: easy_entrez-0.2.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6

File hashes

Hashes for easy_entrez-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e1be7c8f1df430c593d1c77c0e0c32896730981d0ea0dd507154f5614ee7cbeb
MD5 a02f8633df4c4e4c9705627da6a52572
BLAKE2b-256 6ff3dac4b75a26019d2e84539b47e2173ccdb806a1136c984c988156aa37407e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page