ChemBDDB: Python Module

chembddb.chembddb.connect()

establishes mysql connection based on the credentials provided during setup

Returns

cur – pointer to the MySQL database; used to execute all SQL queries

Return type

cursor object

chembddb.chembddb.delete(host='', user='', pw='', db='')

Delete a database that was created using chembddb or delete data from one.

Parameters
  • host (str default='') – the hostname is the domain name or server name

  • user (str default='') – the username for mysql

  • pw (str default='') – the password for mysql

  • db (str default='') – the name of the database that needs to be set up

chembddb.chembddb.post_process(sql, from_db)

Helper function to post process the results from the database

Parameters
  • sql (str) – sql query that was created by the search function

  • from_db (tuple of tuples) – results from the database

Returns

  • data (pandas dataframe) – dataframe containing the processed results ready to be displayed

  • columns (list of str) – list of formatted and cleaned column names

chembddb.chembddb.setup(host=- 1, user='', pw='', db='')

Function to setup the database with the chembddb schema

Parameters
  • host (str default='') – the hostname is the domain name or server name

  • user (str default='') – the username for mysql

  • pw (str default='') – the password for mysql

  • db (str default='') – the name of the database that needs to be set up