1 of 1 people found this helpful
for sure you can publish by calling the REST API from Python. https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_ref.htm#Publish_Datasource%3FTocPath%3D…
As far as creating a new datasource, it depends. I know you can create a new extract by calling the Data Extract API. Tableau Data Extract API
But AFAK, there's no way to create a live connection to your db.