BIGIP f5 How to get all pools and members or VIP address port in CSV format

Recently I had a requirement where i needed extract information from bigip f5 to get pools and members in csv, there didn’t seem like any easy way from the F5 so I looked into pyControl and came up with the following script which can log on to the f5 using pyControl and download the data i need into a csv file, see example: usage source code

download script here