Use the dir() or globals() function to get the list of what has been defined yet. Then, to filter and browse your classes use the inspect module
Example toto.py:
class Example(object):
"""class docstring"""
def hello(self):
"""hello doctring"""
pass
Example browse.py:
import inspect
import toto
for name, value in inspect.getmembers(toto):
# First ignore python defined variables
if name.startswith('__'):
continue
# Now only browse classes
if not inspect.isclass(value):
continue
print "Found class %s with doctring \"%s\"" % (name, inspect.getdoc(value))
# Only browse functions in the current class
for sub_name, sub_value in inspect.getmembers(value):
if not inspect.ismethod(sub_value):
continue
print " Found method %s with docstring \"%s\"" % \
(sub_name, inspect.getdoc(sub_value))
python browse.py:
Found class Example with doctring "class docstring"
Found method hello with docstring "hello doctring"
Also, that doesn't really answer your question, but if you're writing a sort of IDE, you can also use the ast module to parse python source files and get information about them