idna - PyPI
https://pypi.org/project/idna12.10.2021 · Usage. For typical usage, the encode and decode functions will take a domain name argument and perform a conversion to A-labels or U-labels respectively. >>> import idna >>> idna. encode ('ドメイン.テスト') b'xn--eckwd4c7c.xn--zckzah' >>> print (idna. decode ('xn--eckwd4c7c.xn--zckzah')) ドメイン.テスト You may use the codec encoding and decoding …