skillfed

tlds

Automatically updated list of valid TLDs taken directly from IANA

tlds v2026072401 110.1K downloads/30d#12,483 on PyPI5
Permissive license MIT Active released

What it is and what it does

tlds is a lightweight Python package that exposes a set of all valid top-level domains sourced directly from IANA's official TLD list. The package is updated automatically every day to reflect any new or modified TLDs. It provides a simple membership-test interface—you import a set called tld_set and check whether a given TLD string belongs to it, making it straightforward to validate domain extensions in applications that need to distinguish real TLDs from invalid ones.

The package has no runtime dependencies, making it quick to install and integrate. It's classified as Production/Stable and has been maintained since 2018. With a permissive MIT license and active maintenance, it's a practical choice for any application that needs reliable, up-to-date TLD validation without external API calls.

Use it for:

  • Validate domain extensions during email or URL parsing to reject fake or misspelled TLDs
  • Filter domain lists in web scraping or DNS enumeration tools to identify only legitimate domain suffixes
  • Check whether a user-supplied domain extension is real before attempting registration or DNS lookups
  • Build domain classification or categorization logic that depends on knowing which TLDs are official
  • Implement client-side domain validation in web forms to catch obvious TLD typos before submission

Worth the install?

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

Provides a set of valid top-level domains (TLDs) automatically updated daily from IANA, allowing you to check whether a domain suffix is legitimate.

Yes. The package solves a real problem—reliable TLD validation—with zero dependencies, low friction, active maintenance, and a permissive license. Daily updates ensure the list stays current with IANA. Use it whenever you need to distinguish valid TLDs from invalid ones without calling an external API.

Install

tlds on PyPI

pip

pip install tlds

uv

uv add tlds

poetry

poetry add tlds

Installing tlds

Before you install

Low install friction with no runtime dependencies. Actively maintained with a recent release (19 days old) and daily updates to stay current with IANA's official TLD list.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install tlds

from tlds import tld_set

if 'com' in tld_set:
    print('Valid TLD')
if 'pizza' in tld_set:
    print('Also valid')

Verify before relying

  • Whether the daily update mechanism is guaranteed to stay synchronized with IANA or if there are known lag windows
  • Whether the package supports internationalized domain names (IDN) or only ASCII TLDs

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 19 days since the last release
Last repo commit
First released
Downloads 110,107/month — #12,483 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tlds-2026072401-py2.py3-none-any.whl

Keywords: tld

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonTopic :: Communications

Tags

tld validationdomain suffix checkeriana tld listvalid tlds pythontop level domain lookupdomain extension validatortld set membership
domain-validationiana-data

More Communications packages