cursor

cursor(version: str | int | float | VersionInfo | None = None, *, prefix: Sequence[str] | None = None) Generator[Cursor][source]

Ensure, connect, and get a cursor from the database to the database.

Parameters:
  • version – The version number of ChEMBL to get. If none specified, uses latest() to look up the latest.

  • prefix – The directory inside pystow to use

Yields:

The SQLite cursor object.

Example: .. code-block:: python

import chembl_downloader

with chembl_downloader.cursor() as cursor:

cursor.execute(…)