def populate_albums_table(db_session, artist_id, l):
    if not l: # list is empty
        return False
    #print list
    c = db_session.cursor()
    c.execute("""DELETE FROM albums WHERE artist_id = ?""", [artist_id])
    for album_list in l:
        c.execute("""INSERT INTO albums (artist_id, album_id, name, year, precise_rating)
            VALUES (?,?,?,?,?)""", album_list)
    db_session.commit()
    c.close()
    return True
Save the list of albums in the albums table.
dataset/ETHPy150Open bahamas10/Viridian/AmpacheTools/dbfunctions.py/populate_albums_table