Needs some work - but just incase anyone tries to do the same a python version is at https://github.com/willwade/speechmarkdown-py