UP Stars Hercules, implemented in Python