Commits

Anonymous committed b086269

Created a class to stub out the ability to stat track the gas prices picked up by the scraper. Need to create a central class to call the scraper and pass the data to the stat tracker. Using sqlite3 for a file db.

  • Participants
  • Parent commits 9d25ec9

Comments (0)

Files changed (2)

GasStatTracker.py

+import sqlite3
+conn = sqlite3.connect('./db')
+cur = conn.cursor()
+#cur.execute('create table test (id, test_col)')
+#cur.execute('insert into test values(2,\"hello\")')
+#cur.close()
+cur.execute('select id from test')
+print cur.fetchall()
+
+
+class GasStatTracker():
+
+    def __init__(self):
+        self.conn = sqlite3.connect('./gasStatDB')
+        c = self.conn.cursor()
+        c.execute('select name from sqlite_master where type = \'table\'')
+        tables = c.fetchall()
+        if c.rowcount <= 0 and tables.count('gas_history') <= 0:
+            c.execute('create table gas_history (id, station_name, price, location,date)')
+        c.close
+    ##
+    def insertRecords(self,price_data):
+        pass
+    ##
+        
Binary file added.