Python wrapper around the c routine