Adding prefilled data for stadiums and teams, first bits of data

This commit is contained in:
2025-04-02 17:13:32 -04:00
parent 7859f47f77
commit 5950a8c8d1
4 changed files with 417 additions and 27 deletions

View File

@@ -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