Spaces:
Sleeping
Sleeping
Victor Rivera
commited on
Commit
•
e71effe
1
Parent(s):
372abc5
DataPath de HuggingFace
Browse files- dataBaseSetup.py +14 -10
dataBaseSetup.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import sqlite3
|
2 |
import pandas as pd
|
|
|
3 |
|
4 |
def create_connection():
|
5 |
""" Create a database connection to the SQLite database """
|
@@ -128,16 +129,19 @@ def main():
|
|
128 |
|
129 |
# Data import paths
|
130 |
data_paths = {
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
141 |
|
142 |
# Import data to tables
|
143 |
for table_name, csv_path in data_paths.items():
|
|
|
1 |
import sqlite3
|
2 |
import pandas as pd
|
3 |
+
from datasets import load_dataset
|
4 |
|
5 |
def create_connection():
|
6 |
""" Create a database connection to the SQLite database """
|
|
|
129 |
|
130 |
# Data import paths
|
131 |
data_paths = {
|
132 |
+
"customers": "CSV/customers.csv",
|
133 |
+
"staffs": "CSV/staffs.csv",
|
134 |
+
"products": "CSV/products.csv",
|
135 |
+
"categories": "CSV/categories.csv",
|
136 |
+
"stores": "CSV/stores.csv",
|
137 |
+
"brands": "CSV/brands.csv",
|
138 |
+
"stocks": "CSV/stocks.csv",
|
139 |
+
"orders": "CSV/orders.csv",
|
140 |
+
"order_items": "CSV/order_items.csv",
|
141 |
+
}
|
142 |
+
|
143 |
+
dataset = load_dataset('VicGerardoPR/InteractiveDatabseApp', data_files=data_paths)
|
144 |
+
|
145 |
|
146 |
# Import data to tables
|
147 |
for table_name, csv_path in data_paths.items():
|