nectarchain.utils.dbhandler.SQLiteDB#
- class SQLiteDB(dbfilename, tmin=None, tmax=None, verbose=False, **kwargs)[source]#
Bases:
objectInterface 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 one or multiple db to the class Accept str, list, set ,tuple of string as input
Alias for
get_table_names().Get a pandas dataframe from a given table name.
Return the set of table names loaded from the SQLite files.
Return
{table_name: {column_names}}for every table in db.Log all table names and their columns known from the SQLite files.
Attributes
Maximum time (UTC) used for selecting entries from the database.
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
- static get_tables_infos_from_sqlitefile(db)[source]#
Return
{table_name: {column_names}}for every table in db.
- property tmax#
Maximum time (UTC) used for selecting entries from the database.
- property tmin#
Minimum time (UTC) used for selecting entries from the database.