Port of jath to Python