15 lines
535 B
Python
15 lines
535 B
Python
#!.venv/bin/python
|
|
# Import necessary modules
|
|
from utils.database.loader_action import load_data, update_status, DATA_LOADED
|
|
from utils.csv.data_preparation import make_matrix
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
# Define the main function for loading data
|
|
async def main_loader(cfg: object, id: int) -> None:
|
|
# Create a matrix of values from the data
|
|
matrice_valori = make_matrix(cfg, id)
|
|
# Load the data into the database
|
|
if load_data(cfg, matrice_valori):
|
|
update_status(cfg, id, DATA_LOADED) |