--- id: idna version: "3.18" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # idna — Internationalized Domain Names in Applications (IDNA) License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install idna uv add idna poetry add idna ## Description # Internationalized Domain Names in Applications (IDNA) Support for [Internationalized Domain Names in Applications (IDNA)](https://tools.ietf.org/html/rfc5891) and [Unicode IDNA Compatibility Processing](https://unicode.org/reports/tr46/). It supersedes the standard library's `encodings.idna`, which only implements the 2003 specification, offering broader script coverage and limiting domains with known security vulnerabilities. ## Usage Package may be installed from [PyPI](https://pypi.org/project/idna/) via the typical methods (e.g. `python3 -m pip install idna`) For typical usage, the `encode` and `decode` functions will take a domain name argument and perform a conversion to ASCII-compatible encoding (known as A-labels), or to Unicode strings (known as U-labels) respectively. ```pycon >>> import idna >>> idna.encode('ドメイン.テスト') b'xn--eckwd4c7c.xn--zckzah' >>> print(idna.decode('xn--eckwd4c7c.xn--zckzah')) ドメイン.テスト ``` Conversions can be applied at a per-label basis using the `ulabel` or `alabel` functions for specialized use cases. ### Compatibility Mapping (UTS #46) This library provides support for [Unicode IDNA... ## AI interpretation — verify before relying idna converts domain names between Unicode and ASCII-compatible encoding (punycode) formats, implementing the IDNA 2008 standard and Unicode Compatibility Processing to handle internationalized domain names securely. Verdict: idna is a mature, actively maintained standard library for IDNA domain conversion with zero dependencies, permissive licensing, and no known vulnerabilities. It is suitable for production use in any application requiring internationalized domain name handling. [View on SkillFed](https://skillfed.io/packages/idna) · [View on PyPI](https://pypi.org/project/idna/)