query
- query(sql, version=None, *, prefix=None, **kwargs)[source]
Ensure the data is available, run the query, then put the results in a dataframe.
- Parameters:
sql (
str
) – A SQL query string or table nameversion (
Optional
[str
]) – The version number of ChEMBL to get. If none specified, useslatest()
to look up the latest.prefix (
Optional
[Sequence
[str
]]) – The directory insidepystow
to usekwargs – keyword arguments to pass through to
pandas.read_sql()
, such asindex_col
.
- Return type:
DataFrame
- Returns:
A dataframe
Example: .. code-block:: python
import chembl_downloader from chembl_downloader.queries import ID_NAME_QUERY_EXAMPLE
df = chembl_downloader.query(ID_NAME_QUERY_EXAMPLE)