You can easily scan all your files and folders, find all python files, and get only docstrings out of them with some regex matching, something like this:
import re
import os
import xmlutils # download it from: https://gist.github.com/huseyinyilmaz/1448723
my_dir = '<absolute path to my dir>'
doc_dict = dict()
for root, dirs, files in os.walk(my_dir):
for filename in files:
if filename.endswith('.py'):
with open(os.path.join(root, filename), 'r') as py_file:
basename = os.path.basename(filename)
doc_dict[basename] = [m.group('doc') for m in re.finditer(
re.compile(r'("|\'){3}(?P<doc>.*?)\1{3}', re.DOTALL),
py_file.read()
)]
dict2xml(dict(root=doc_dict))