Python: Add truncate transform (#5030)