I have a python script that outputs the program name, version number and the author when called with command line arguments like --help or --version. Currently this information is hardcoded in the python script itself. But I use distutils for building/packaging the application so all this information is already present in the setup.py. Is it possible to let distutils write metadata like version and author name/email to the built python script so I only need to maintain this data in the setup.py file? Or is there another standard mechanism to handle stuff like that?
Do it the other way around.  Add the version number, the author name and other metadata you need in the script to the script itself.  Then import or execfile() the script in setup.py, and use the metadata defined in the script as arguments to the setup() function.
Replace symbols in python script on distribution