connect

connect(version=None, *, prefix=None)[source]

Ensure and connect to the database.

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

  • prefix (Optional[Sequence[str]]) – The directory inside pystow to use

Yields:

The SQLite connection object.

Example: .. code-block:: python

import chembl_downloader

with chembl_downloader.connect() as conn:
with closing(conn.cursor()) as cursor:

cursor.execute(…)