Ok it's not pretty code, but it is working code (and GPLv3 licensed,
so share and enjoy).
This is a simple Python script to export a list of users, it
essentially emulates a user logging in to Google Apps, clicking on the
groups management and then clicking through the lists manually
(hitting "Next" if there is a Next page since it only shows 30 groups
or users at a time). It then saves the list name, user name, email
address and membership role into a CSV file.
To make it work simply change the domain name, user name and password
to yours and it should work.
TODO: main thing is to add support for Google CLI to upload the CSV
file, and to fix up the lxml html parsing (I'm used to BeautifulSoup,
but apparently lxml is the standard now).
If anyone has patches/etc. please feel free to send them to me so I
can improve the code.