Hi JobinJames,
Thanks for taking time to share your thoughts with us.
The diagsession file is a .ZIP archive that contains multiple .ETL files and .XML metadata files. So I'm afraid that you could not open it with python script or transfer it to csv file.
Maybe you could try to change "diagsession" to "zip", then unzip it to analysis etl and xml files directly.
Best Regards,
Dylan