Initial port from python (PyX) + example