Python : Data Parsing

In this assignment I was tasked with loading in information into an SQL database using Python. This combines normal Python coding skills with requirements of proper loading techniques that adhere to the standards of SQL. There are various comments detailing issues that could potentially arise when writing this type of code and how to avoid these pitfalls.

Download the source files and open the folder. Inside you will see two files, Loan.csv and LoanScript.py. The Loan.csv file contains information regarding Loans, such as person, purpose, state etc., and the LoanScript.py file runs through those items. The script is very simple, it creates a large list of insert statements and uses a print statement to create an insert statement that SQLDeveloper can read. It also uses some replace() methods to ensure that any aposthres that could cause potential errors are removed. 

At the end, we get a large list of statements that we can then use to copy and paste into SQLDeveloper to create a new database containing this information. A demo showcasing these steps is given below.

Source Files