import sqlite3
connection = sqlite3.connect('/path/to/temp.sqlite')
cursor = connection.cursor()
cursor.execute('ATTACH "/path/to/main.sqlite" AS master')
Python - Bulk Select then Insert from one DB to another