if verbose:
print("\n-> Create tables")
- with open("tables.sql") as tables:
+ with open("tables.sql", encoding="utf-8") as tables:
cur.executescript(tables.read())
if verbose:
file_path_full = os.path.join("data", file_path)
# Loop over CSV files
- with open(file_path_full) as csv_file:
+ with open(file_path_full, encoding="utf-8") as csv_file:
reader = csv.DictReader(csv_file)
values = ",".join("?" * len(reader.fieldnames))
reader = csv.reader(csv_file)
CREATE TABLE cf_dat (
cf_id int NOT NULL,
- nutr_id int NOT NULL, -- no FK constraing on usda :[
+ nutr_id int NOT NULL, -- no FK constraining on usda :[
nutr_val real NOT NULL,
notes text,
PRIMARY KEY (cf_id, nutr_id),