cellpy.utils.batch_tools.sqlite_from_excel_db#

Module Contents#

Classes#

DbColsRenamer

Functions#

clean_up(df, columns)

Clean up the dataframe and return using 'proper cellpy headers'.

create_column_names_from_prms()

Create a list of DbColsRenamer objects from the cellpy.prms.DbCols object.

load_xlsx([db_file, table_name, header_row, unit_row])

Load the Excel file and return a pandas dataframe.

main()

run()

save_sqlite(sheet[, out_file, table_name, set_index])

Save the pandas dataframe to a sqlite database.

Attributes#

DB_FILE_EXCEL

DB_FILE_SQLITE

HEADER_ROW

TABLE_NAME_EXCEL

UNIT_ROW

class DbColsRenamer[source]#
cellpy_col: str = ''[source]#
db_col: str = ''[source]#
dtype: str = ''[source]#
excel_col: str = ''[source]#
clean_up(df, columns)[source]#

Clean up the dataframe and return using ‘proper cellpy headers’.

create_column_names_from_prms()[source]#

Create a list of DbColsRenamer objects from the cellpy.prms.DbCols object.

load_xlsx(db_file=DB_FILE_EXCEL, table_name=TABLE_NAME_EXCEL, header_row=HEADER_ROW, unit_row=UNIT_ROW)[source]#

Load the Excel file and return a pandas dataframe.

main()[source]#
run()[source]#
save_sqlite(sheet, out_file=DB_FILE_SQLITE, table_name=TABLE_NAME_SQLITE, set_index=False)[source]#

Save the pandas dataframe to a sqlite database.

DB_FILE_EXCEL[source]#
DB_FILE_SQLITE[source]#
HEADER_ROW[source]#
TABLE_NAME_EXCEL[source]#
UNIT_ROW[source]#