intake_sqlite.sqlite_src
#
SQLite Intake driver classes.
Module Contents#
Classes#
Read the full results of an SQL query into a dataframe. |
|
SQLite Table reader with automatic partitioning. |
|
SQLite expression reader with explicit partitioning. |
Functions#
|
Transform a file path or URL into a local SQLite URL. |
- class intake_sqlite.sqlite_src.SQLiteSource(urlpath: str, sql_expr: str, sql_kwargs: dict[str, Any] = {}, metadata: dict[str, Any] = {}, storage_options: dict[str, Any] = {})[source]#
Bases:
intake_sql.SQLSource
Read the full results of an SQL query into a dataframe.
- Parameters:
urlpath – A local path or
fsspec
readable URL pointing to a SQLite database.sql_expr – Query expression to pass to the SQLite database backend.
sql_kwargs – Additional arguments to pass in to
pandas.read_sql()
.metadata – Arbitrary metadata dictionary associated with the data source.
storage_options – Keyword arguments passed to
fsspec.open_local()
- class intake_sqlite.sqlite_src.SQLiteSourceAutoPartition(urlpath: str, table: str, index: str, sql_kwargs: dict[str, Any] = {}, metadata: dict[str, Any] = {}, storage_options: dict[str, Any] = {})[source]#
Bases:
intake_sql.SQLSourceAutoPartition
SQLite Table reader with automatic partitioning.
- Parameters:
urlpath – A local path or
fsspec
readable URL pointing to a SQLite database.table – Name of the table to read from the database.
index – Name of the column to use for partitioning and as the index of the resulting dataframe.
sql_kwargs – Additional arguments to pass to
dask.dataframe.read_sql()
.metadata – Arbitrary metadata dictionary associated with the data source.
storage_options – Keyword arguments passed to
fsspec.open_local()
- class intake_sqlite.sqlite_src.SQLiteSourceManualPartition(urlpath: str, sql_expr: str, where_values: list[Any], where_template: str | None = None, sql_kwargs: dict[str, Any] = {}, metadata: dict[str, Any] = {}, storage_options: dict[str, Any] = {})[source]#
Bases:
intake_sql.SQLSourceManualPartition
SQLite expression reader with explicit partitioning.
- Parameters:
urlpath – A local path or
fsspec
readable URL pointing to a SQLite database.sql_expr – Query expression to pass to the SQLite database backend.
where_values – list of str or list of values/tuples Either a set of explicit partitioning statements (e.g., “WHERE index_col < 50”…) or pairs of valued to be entered into where_template, if using
where_template – str (optional) Template for generating partition selection clauses, using the values from where_values, e.g., “WHERE index_col >= {} AND index_col < {}”
sql_kwargs – Additional arguments to pass to
dask.dataframe.read_sql()
.metadata – Arbitrary metadata dictionary associated with the data source.
storage_options – Keyword arguments passed to
fsspec.open_local()