idna

Internationalized Domain Names for Python — IDNA 2008 and UTS #46 encoding and decoding

Library
PyPI
v3.19
291stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
82/100Excellent
Development Activity100
Maintenance72
Community76
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture85
Code Quality88
Innovation86
Learning Curve72

idna is a pure-Python library implementing Internationalized Domain Names in Applications (IDNA 2008, RFC 5891) together with Unicode IDNA Compatibility Processing (UTS #46). It converts domain names between their Unicode representation (U-labels) and ASCII-compatible xn— encoding (A-labels), superseding the standard library’s older encodings.idna module.

With broader script coverage than the 2003 specification and built-in validation that rejects domains with known security issues, idna is a foundational dependency across the Python ecosystem, used by HTTP clients such as Requests, urllib3, and httpx to correctly handle non-ASCII domain names.

What You Get

  • encode() and decode() functions that convert whole domains between Unicode and ASCII-compatible xn— form
  • IDNA 2008 (RFC 5891) validation with bidirectional, contextual-joiner, and codepoint checks
  • Optional UTS #46 compatibility mapping (uts46=True) that normalizes user input before conversion
  • Per-label alabel/ulabel helpers and a registered idna2008 codec for str.encode('idna2008')
  • A command-line idna tool for converting domains from the shell or standard input

Common Use Cases

  • Normalizing and encoding non-ASCII hostnames before making network requests
  • Validating that a user-supplied domain conforms to IDNA 2008 rules
  • Displaying Unicode domain names decoded from their xn— Punycode form in user interfaces

Under The Hood

Architecture The public surface lives in idna/core.py, where encode() splits a domain on the four Unicode label separators via _unicode_dots_re, optionally applies UTS #46 remapping through uts46_remap() (backed by the generated tables in uts46data.py), then Punycode-encodes each label with alabel(); alabel() runs the full validation stack — check_label() enforces bidirectional rules (RFC 5893), hyphen and initial-combiner constraints, and contextual joiners (CONTEXTJ/CONTEXTO) — before prepending the xn-- prefix. decode() reverses the process, and codec.py registers a stateless idna2008 codec plus incremental encoder/decoder classes. Tech Stack It is pure Python targeting 3.9+ with zero runtime dependencies, leaning only on the standard library (unicodedata, bisect, re, codecs); it builds with the flit_core backend, ships a py.typed marker, and generates its large idnadata.py/uts46data.py lookup tables offline via the scripts in tools/. Development tooling is ruff (with bugbear, simplify, pyupgrade, and perflint rule sets), mypy, and pytest. Code Quality Codepoint membership is answered in O(log n) by intranges.py, which packs sorted ranges into single integers (start << 32 | end) and binary-searches them, and hot bidi category sets are hoisted to module-level frozensets to stay out of the per-codepoint loop. The code is fully type-annotated, exposes a clean exception hierarchy (IDNAError with IDNABidiError, InvalidCodepoint, InvalidCodepointContext), and is exercised by a tests/ suite covering core, UTS #46, the codec, the CLI, compat, and the intranges helper. API Design The surface is deliberately small and mirrors familiar codec naming: encode/decode for whole domains, alabel/ulabel per label, an uts46=True flag for compatibility mapping, and a display=True option for leaving undecodable labels intact in UIs. Registering the idna2008 codec lets callers use str.encode('idna2008'), and a bundled CLI plus a concise, example-driven README keep the getting-started boilerplate near zero.

Used by 25 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
C++
74%
Other

Dragonfly

Databases · Developer Tools · Devops

31,013

A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.

View details
90
Repo Health
9
Technical
71
Dependency
Built with
C++74%
Python16%
Updated today
HTML
85%
Apache 2.0

Elementary

Data Engineering · Monitoring · Analytics

2,393

The dbt-native data observability CLI that turns your existing dbt tests and metadata into anomaly detection, lineage graphs, and Slack/Teams alerts — no separate platform required.

View details
89
Repo Health
75
Technical
79
Dependency
Built with
HTML85%
Python15%
Updated yesterday
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
HTML
48%
LGPL-2.1

Horilla

Human Resources · ERP

1,330

Open-source HRMS covering recruitment, attendance, payroll, and biometrics in one self-hosted Django application.

View details
88
Repo Health
60
Technical
65
Dependency
Built with
HTML48%
Python35%
JavaScript13%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search