intake_sqlite.sqlite_src#

SQLite Intake driver classes.

Module Contents#

Classes#

SQLiteSource

Read the full results of an SQL query into a dataframe.

SQLiteSourceAutoPartition

SQLite Table reader with automatic partitioning.

SQLiteSourceManualPartition

SQLite expression reader with explicit partitioning.

Functions#

urlpath_to_sqliteurl(→ str)

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()

name = sqlite[source]#
version[source]#
container = dataframe[source]#
partition_access = True[source]#
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()

name = sqlite_auto[source]#
version[source]#
container = dataframe[source]#
partition_access = True[source]#
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()

name = sqlite_manual[source]#
version[source]#
container = dataframe[source]#
partition_access = True[source]#
intake_sqlite.sqlite_src.urlpath_to_sqliteurl(urlpath: str, storage_options: dict[str, Any] = {}) str[source]#

Transform a file path or URL into a local SQLite URL.