I am needing to take an Excel file, transform the data and then save the transformed data in another sheet of the same Excel file. As of now, I am doing this by manually importing the Excel source sheet into a table within Microsoft SQL Server Management Studio, running my SQL script to transform the data and create a view of it. I then simply copy and paste this transformed data from the view back into a second sheet of the Excel file.
I am looking to automate this process using Python, but am very lost as to how to get started. I have seen packages such as pyodbc and pymysql which I could use to execute my script, but it is the importing/exporting the data to/from Excel that I cannot figure out.
Can either of these packages be integrated with SSMS to which the data can be imported/exported from a specified Excel file? Can SSMS be avoided altogether somehow by importing the Excel data into a table that my SQL script can then execute on?
Any suggestions are very welcome.