title: Are there any libraries for generating Python source?
body: <p>I'd like to write a code generation tool that will allow me to create sourcefiles for dynamically generated classes.  I can create the class and use it in code, but it would be nice to have a sourcefile both for documentation and to allow something to import.</p>
  
  <p>Does such a thing exist?  I've seen <a href="http://pypi.python.org/pypi/sourcecodegen/0.6.11" rel="nofollow noreferrer">sourcecodegen</a>, but I'd rather avoid messing with the ast trees as they're not portable.</p>