Python Rinci/Riap implementation