api_key=os.environ.get("IPDATA_API_KEY") is a default parameter, evaluated once at import time. If a user sets IPDATA_API_KEY after importing ipdata and then calls IPData(), it raises IPDataException. The fix is to use api_key=None as the default and check os.environ.get() inside the method body.
api_key=os.environ.get("IPDATA_API_KEY") is a default parameter, evaluated once at import time. If a user sets IPDATA_API_KEY after importing ipdata and then calls IPData(), it raises IPDataException. The fix is to use api_key=None as the default and check os.environ.get() inside the method body.