I really don't know what you're trying to do here but you have some misunderstandings about how Tableau works.
A .tde or .hyper file IS the data, in Tableau's proprietary database format. You cannot see how those files are created: that is an internal process.
A datasource is the version of the .tde or .hyper file that is published to Tableau Server or to Tableau Online, (It's also the local representation of the data that you create in Tableau Desktop, but because you're asking about APIs, I'm only going to worry about Server.)
The workflow is:
In Desktop, you connect to a root source of data (say, SQL Server). You create an extract, which produces a TDE or Hyper file depending on the version of Tableau you are using. From Desktop, you then publish this extract to Tableau Server, where it becomes a published data source. Visualizations that are created from that data source use whatever subset of data in the TDE or Hyper file is needed to produce the viz (or view, in the Tableau Server).
When you call the views.populate_csv function, you get the subset of data in that specific view as a CSV file. So the data comes from the TDE or Hyper file, but is presented to you as a CSV.
A TDS file is completely different. It contains ONLY the information needed to connect to the root source of data, not the data itself. You can create a TDSX file, which DOES contain the data, but that is relatively uncommon.
You can use the REST API to manually initiate a refresh of a Tableau Server published data source, but you cannot create or refresh a data source without using Tableau. There is no way (that I am aware of) to create a separate Python or other program that does not involve Tableau Server.
Applications like Alteryx or EasyMorph or Informatica DO allow you to create TDE and/or Hyper files independently, but they have licensed that capability from Tableau. The extract creation code is NOT open source.