With some web search, I have a code example that can plot from the weewx.sdb directly. Maybe this will help someone.
import sqlite3, pandas , matplotlib.pyplot as plt
from datetime import datetime
conn = sqlite3.connect("weewx.sdb")
c = conn.cursor()
def ftoc(t):
return float((t-32)/1.8)
def mtok(v):
return (v*1.60934)
def graph_data():
c.execute('SELECT dateTime, outTemp, windGust FROM archive \
WHERE dateTime BETWEEN STRFTIME("%s", "2023-01-23") AND STRFTIME("%s", "2023-01-25") ')
data = c.fetchall()
date = []
temperature = []
gust = []
for row in data:
date.append(datetime.fromtimestamp(row[0]))
temperature.append( ftoc(row[1]) )
gust.append( mtok(row[2]) )
plt.plot_date(date,temperature,'-')
plt.plot_date(date,gust,'-')
plt.show()
graph_data()
četrtek, 19. januar 2023 ob 20:49:04 UTC+1 je oseba mihec napisala: