I think the easiest way is to have your python program read the database.
import sqlite3
from sqlite3 import Error
import datetime
import time
import json
Connected = False
database = r"C:\users\peter\weewx.sdb"
try:
conn = sqlite3.connect(database)
except Error as e:
pass
querystring = "SELECT dateTime, barometer,inTemp,extraTemp2,outTemp,pm2_5,pm10_0 from archive where dateTime>?"
lasttime = 1644172560
while True:
cur = conn.cursor()
column_name=[col[0] for col in cur]
cur.execute(querystring,(str(lasttime),))
try:
row = [ dict(line) for line in [zip([ column[0] for column in cur.description], row) for row in cur.fetchall()] ]
print ("------")
<<do something here>>
lasttime = (row[len(row)-1]["dateTime"])
print (lasttime)
except:
print ("error")
time.sleep(10)