Added an importable python api, should work not heavily tested