libgs.database.PassDb

class libgs.database.PassDb(db='sqlite:///libgs.db', binary_fmt='b64', disk_threshold=1000, disk_path='.', **kwargs)[source]

Interface class to Pass Information Database.

The Pass Information Database is a key/value type database that stores arbitrary data about a pass (pass information). Each key/value pair is associated with the pass id and module from which it was added for easy search.

It sets up a table with the following columns

key The pass information key
value The pass information value
pass_id The pass id associated with the current monitor entry
module The module that requested the data to be added to the database

Additionally each row is assigned a primary key and a timestamp

Methods

put(module, pass_id, key, value) Add a key/value pair to the database

Inherited from base class

count_rows(table) Return the number of rows in a table
create_table(name, *columns, **kwargs) Set up the columns and add a unique key.
get([limit, keys, tstamps]) Get data from the database.
get_df(table[, where, limit, orderby, …]) Get data from communications database as a pandas.DataFrame object
get_file(fname) Grab a file resource and return the bytes or string (.bin or .txt)
put_df(table, df[, index, if_exists]) Add dataframe to database, appending metadata for when it was added