Should look at either a pure python implementation or wrap it. It was a template if I remember correctly.