Galaxy Generator
This Python script generates a 3D galaxy from a number of parameters and stores it in an array. You can modify this script to store the data in a database or whatever your purpose is. THIS script uses the data only to generate a PNG with a 2D view from top of the galaxy.
The algorithm used to generate the galaxy is borrowed from Ben Motz The original C source code for DOS (including a 3D viewer) can be downloaded here: http://bits.bristol.ac.uk/motz/tep/galaxy.html
Download: galaxygen.py
I was in the middle of developing a game in python and needed to generate a spiral galaxy. I went searching... and found this little script, exactly what I wanted. It even outputs the data in the formats I need - both list and png! Thanks a bunch for putting this out.