nectarchain.utils.dbhandler.SQLiteDB#

class SQLiteDB(dbfilename, tmin=None, tmax=None, verbose=False, **kwargs)[source]#

Bases: object

Interface to one or more SQLite database files containing camera monitoring data.

Parameters:
dbfilenamestr or list of str

Path (or list of paths) to SQLite database files.

tmindatetime-like, optional

Minimum time (UTC) for selecting entries.

tmaxdatetime-like, optional

Maximum time (UTC) for selecting entries.

verbosebool, optional

Enable verbose logging.

Initialise the SQLite database interface.

Parameters:
dbfilenamestr or list of str

Path (or list of paths) to SQLite database files.

tmindatetime-like, optional

Minimum time (UTC) for selecting entries.

tmaxdatetime-like, optional

Maximum time (UTC) for selecting entries.

verbosebool, optional

Enable verbose logging.

Methods

add_db

Add one or multiple db to the class Accept str, list, set ,tuple of string as input

get_available_tables

Alias for get_table_names().

get_table

Get a pandas dataframe from a given table name.

get_table_names

Return the set of table names loaded from the SQLite files.

get_tables_infos_from_sqlitefile

Return {table_name: {column_names}} for every table in db.

show_available_infos

Log all table names and their columns known from the SQLite files.

Attributes

tmax

Maximum time (UTC) used for selecting entries from the database.

tmin

Minimum time (UTC) used for selecting entries from the database.

add_db(dbfilename)[source]#

Add one or multiple db to the class Accept str, list, set ,tuple of string as input

get_available_tables()[source]#

Alias for get_table_names().

get_table(table_name)[source]#

Get a pandas dataframe from a given table name. The access is perhaps not safe as one can have some problem

get_table_names()[source]#

Return the set of table names loaded from the SQLite files.

static get_tables_infos_from_sqlitefile(db)[source]#

Return {table_name: {column_names}} for every table in db.

show_available_infos()[source]#

Log all table names and their columns known from the SQLite files.

property tmax#

Maximum time (UTC) used for selecting entries from the database.

property tmin#

Minimum time (UTC) used for selecting entries from the database.