Instead of using ast, you might consider using inspect.get_members() like in https://github.com/cclauss/Ten-lines-or-less/blob/master/platform_info.py
dir() is also usable for quick and dirty scripts.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.