Is there any python api for getting account name by inputting public key? I have got this code from developers portal, but I don't know how to use it.
import requests
url = "http://host/:port/v1/history/get_key_accounts"
headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}
response = requests.request("POST", url, headers=headers)
print(response.text)