Workings on pushing data from Excel/CSVs to a database using Python Opens and manipulates files and then sends them to a mysql database Currently working for pnpc, parmalat, weather_sa and pvspot
Required modules (must be installed on computer): sqlalchemy, pymysql, pandas
Files to upload must be in the directory specified on line 127 (currently dirname='C:/push_to_db/')
Database info must be on line 142, in the format below:
engine = create_engine('dialect+driver://username:password@host:port/database', echo=False)
(currently engine = create_engine('mysql+pymysql://root:ep101@localhost/ei_db', echo=False))
The majority of the code in this script deals with importing the files and manipulating them into the correct formats to send to the DB.
PNG files in this repository show how the database and its tables need to be set up beforehand.