replace shell scripts and Makefile with python