database/Populate_database.py
def insert_entry_in_table(dataname, checktag, data, table, overwrite=False):
        """
        dataname: value of indentifying key for entry in table
        checktag: name of the identifying key ['those before the --- in the table declaration']
        data: entry to be inserted into the table
        table: database table
        """
        if dataname in list(table.fetch(checktag)):
                return
        try:
            table.insert1(data)
            print('     ... inserted {} in table'.format(dataname))
        except:
            if dataname in list(table.fetch(checktag)):
                    print('Entry with id: {} already in table'.format(dataname))
            else:
                print(table)
                raise ValueError('Failed to add data entry {}-{} to {} table'.format(checktag, dataname, table.full_table_name))

        dataname: value of indentifying key for entry in table
        checktag: name of the identifying key ['those before the --- in the table declaration']
        data: entry to be inserted into the table
        table: database table
        
value of indentifying key for entry in table
checktag: name of the identifying key ['those before the --- in the table declaration']
data: entry to be inserted into the table
table: database table
value of indentifying key for entry in table checktag : name of the identifying key [ ' those before the --- in the table declaration ' ] data : entry to be inserted into the table table : database table
def insert_entry_in_table(dataname, checktag, data, table, overwrite=False):
        if dataname in list(table.fetch(checktag)):
                return
        try:
            table.insert1(data)
            print('     ... inserted {} in table'.format(dataname))
        except:
            if dataname in list(table.fetch(checktag)):
                    print('Entry with id: {} already in table'.format(dataname))
            else:
                print(table)
                raise ValueError('Failed to add data entry {}-{} to {} table'.format(checktag, dataname, table.full_table_name))
def insert_entry_in_table ( dataname , checktag , data , table , overwrite = False ) : if dataname in list ( table . fetch ( checktag ) ) : return try : table . insert1 ( data ) print ( '     ... inserted {} in table' . format ( dataname ) ) except : if dataname in list ( table . fetch ( checktag ) ) : print ( 'Entry with id: {} already in table' . format ( dataname ) ) else : print ( table ) raise ValueError ( 'Failed to add data entry {}-{} to {} table' . format ( checktag , dataname , table . full_table_name ) )
dataname: value of indentifying key for entry in table
checktag: name of the identifying key ['those before the --- in the table declaration']
data: entry to be inserted into the table
table: database table
dataname : value of indentifying key for entry in table checktag : name of the identifying key [ ' those before the --- in the table declaration ' ] data : entry to be inserted into the table table : database table
"""
        dataname: value of indentifying key for entry in table
        checktag: name of the identifying key ['those before the --- in the table declaration']
        data: entry to be inserted into the table
        table: database table
        """
dataname
checktag
data
table
overwrite