Add doc.py

I wrote this sometime ago. Converted file endings and tossed onto
Github.