First of all, you posted in the wrong forum board. This board is dedicated to general questions/requests about the NI webpages and how the forum works, etc...
Secondly, your question should be raised in a Python forum, do not you think? Since you want to use Python and not LabVIEW to make the conversion. Why do not use simply LabVIEW to convert csv files to TDMS files? Just straightforward and easy!
Anyway, if you must use Python for this conversion, you should check out these websites:
https://github.com/adamreeve/npTDMS
http://nptdms.readthedocs.io/en/latest/
And here about how TDMS files structured, plus ideas about plugin usage:
http://www.ni.com/white-paper/3727/en/