import sqlite3
import datetime
+def check_db_for_training(db,sport,timestamp):
+
+ conn = sqlite3.connect(db)
+ cur = conn.cursor()
+
+ cur.execute ("select count(*) from tracks where sport=? and start_time=?" , (sport,timestamp))
+ return cur.fetchall()[0][0]
+
def write_parsed_to_db(db,gpx,filename):
conn = sqlite3.connect(db)