skillfed

domain2idna

The tool to convert a domain or a file with a list of domain to the famous IDNA format.

domain2idna v1.12.4 110.8K downloads/30d#12,445 on PyPI5
Permissive license MIT https://raw.githubusercontent.com/PyFunceble/domain2idna/master/LICENSE Active released

What it is and what it does

domain2idna is a command-line and library tool that converts domain names and URLs from human-readable Unicode form into Punycode/IDNA format, the standardized ASCII-compatible encoding for internationalized domain names. It reads individual domains, full URLs, or entire files (skipping commented lines starting with #) and outputs the converted results either to the screen or to a file.

The package is designed for domain list and hosts file maintainers who need to normalize international domains for DNS systems or configuration files. It can be used as a standalone CLI tool or imported as a module to integrate domain conversion into other Python applications. With setuptools and colorama as its only runtime dependencies, it installs with low friction and has been actively maintained since 2018.

Use it for:

  • Convert a hosts file containing international domain names to IDNA format for DNS configuration
  • Batch-process a blocklist of domains with non-ASCII characters before deploying to filtering systems
  • Normalize user-supplied domain input in a web application before validation or storage
  • Generate Punycode versions of international domains for compatibility with legacy DNS tools
  • Maintain parallel lists of human-readable and IDNA-encoded domains for documentation

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts domain names and URLs to Punycode/IDNA format, with support for batch processing files and command-line or programmatic use.

Yes. The package solves a specific, well-defined problem (IDNA conversion) with low install friction, permissive licensing, active maintenance, no known vulnerabilities, and a straightforward API suitable for both CLI and programmatic use. Install it if you need to work with internationalized domain names.

Install

domain2idna on PyPI

pip

pip install domain2idna

uv

uv add domain2idna

poetry

poetry add domain2idna

Installing domain2idna

Before you install

Low friction: pure Python wheel with minimal dependencies (setuptools, colorama). Active maintenance with recent commits; last release 202 days ago but repository shows ongoing activity.

License in practice

MIT license (permissive): you can use, modify, and distribute freely with minimal restrictions; include the license and copyright notice in distributions.

Quickstart

pip install domain2idna

from domain2idna import domain2idna

result = domain2idna.convert('münchen.de')
print(result)  # Output: xn--mnchen-3ya.de

Requires Python 3.6.2 or later (supports current Python versions up to <4).

Verify before relying

  • Whether the package handles edge cases in IDNA conversion (e.g., mixed scripts, invalid domains) as documented
  • Performance characteristics when processing very large domain lists
  • Whether commented-line filtering works as intended across different file encodings

Package facts

License MIT https://raw.githubusercontent.com/PyFunceble/domain2idna/master/LICENSE (permissive)
Python support supports the current Python release (<4,>=3.6.2)
Install friction low — pure-Python wheel
Runtime dependencies 2 — setuptools, colorama
Maintenance actively maintained — 202 days since the last release
Last repo commit
First released
Downloads 110,783/month — #12,445 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: domain2idna-1.12.4-py3-none-any.whl

Keywords: Python, domain, idna

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet

Tags

domain to punycode converteridna format conversionbatch domain encodinginternationalized domain namesdomain name normalizationpunycode batch processingurl domain conversion
domain-encodingcli-toolinternationalization

More Internet packages