A small Python script to generate a date dimension for your data warehouse. Uses YYYYMMDD as an intelligent surrogate key.

Use with Python 2.7.x:

kiran@zeus:~$ python makedate.py
makedate.py -s<startyear> -n<numberofyears> -o<outputfilename>
 NOTE: output includes 19000101 record
kiran@zeus:~$ python makedate.py -s1900 -n5 -odate.csv
COMPLETED writing file date.csv

Click here for code