migrate php to python
Merge pull request #4 from lantip/katpy

migrate php to python