import sqlite3 connection = sqlite3.connect('database.db') with open('schema.sql') as f: connection.executescript(f.read()) cur = connection.cursor() cur.execute( "INSERT INTO instruments (name, slug, description, panel) VALUES (?, ?, ?, ?)", ('Test Instrument', 'test_instrument', 'The classic original the one we like to test', 'test_instrument.svg') ) connection.commit() connection.close()