Adding prefilled data for stadiums and teams, first bits of data
This commit is contained in:
@@ -1,4 +1,31 @@
|
||||
import csv
|
||||
from db_connect import Database
|
||||
|
||||
class Importer:
|
||||
def __init__(self, database: Database):
|
||||
self.database = database
|
||||
|
||||
def parse_all_data(self):
|
||||
pass
|
||||
|
||||
def parse_one_file(self, filepath):
|
||||
bb_dict = {}
|
||||
with open(filepath, 'r') as bb_data_file:
|
||||
reader = csv.DictReader(bb_data_file)
|
||||
bb_dict = list(reader)
|
||||
|
||||
for game in bb_dict:
|
||||
self.populate_database_with_stats(game)
|
||||
|
||||
|
||||
def parse_one_line(self, line):
|
||||
pass
|
||||
|
||||
def parse_last_line_of_file(self, filepath):
|
||||
pass
|
||||
|
||||
def populate_database_with_stats(self, bb_game_stats):
|
||||
pass
|
||||
|
||||
def parse_csv(file_path):
|
||||
# Function to parse a CSV file and return an array of dictionaries
|
||||
|
||||
Reference in New Issue
Block a user