Use the xlrd module; start here . [Disclaimer: I am the author]. xlrd classifies cells into text, number, date, boolean, error, empty and empty. It distinguishes dates from numbers by checking the format associated with the cell (for example, "dd / mm / yyyy" compared to "0.00").
The task of programming some code to input user input to determine which type of DB data to use for each column is not something that can be easily automated. You should be able to view data and assign types such as integer, money, text, date, datetime, time, etc. And write code to test your guesses. Please note that you need to be able to cope with things like numeric data or date data entered in text fields (you can see OK in the graphical interface). You need a strategy to handle cells that do not match the “estimated” data type. You need to check and clear the data. Make sure you normalize the text lines (split the line / end of the space, replace several spaces with one space. Excel text (BMP only) is Unicode, not bash it is in ASCII or "ANSI" - it works in Unicode and encode in UTF-8, to put it in your database.
John machin
source share