move python code into codebase