api_connect python scripts