Initial import of Shiv's DGT code
Port to python 3