python socket wrapper / framework