python script to compile documents from sections