code: def load_config_key():
      
      global api_token
      try:
          api_token = os.environ['SOCCER_CLI_API_TOKEN']
      except KeyError:
          home = os.path.expanduser("~")
          config = os.path.join(home, ".soccer-cli.ini")
          if not os.path.exists(config):
              with open(config, "w") as cfile:
                  key = get_input_key()
                  cfile.write(key)
          else:
              with open(config, "r") as cfile:
                  key = cfile.read()
          if key:
              api_token = key
          else:
              os.remove(config)  # remove 0-byte file
              click.secho('No API Token detected. '
                          'Please visit {0} and get an API Token, '
                          'which will be used by Soccer CLI '
                          'to get access to the data.'
                          .format(RequestHandler.BASE_URL), fg="red", bold=True)
              sys.exit(1)
      return api_token
docs: Load API key from config file, write if needed