tlds
Automatically updated list of valid TLDs taken directly from IANA
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 tldsuv
uv add tldspoetry
poetry add tldsInstalling 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
Tags
More Communications packages
Pyasn1 encodes and decodes ASN.1 data…
permissive · top 100 on PyPI
pyasn1-modulesProvides a collection of ASN.1 data structures…
permissive · top 100 on PyPI
kombuKombu is a messaging library that provides a…
permissive · top 1,000 on PyPI
humanfriendlyFormats and parses numbers, file sizes,…
permissive · top 1,000 on PyPI
coloredlogsAdds colored output to Python's standard…
permissive · top 1,000 on PyPI
aiosmtplibaiosmtplib is an asynchronous SMTP client that…
permissive · top 5,000 on PyPI
tldExtracts the top-level domain (TLD) and…
copyleft · top 5,000 on PyPI
tldextractAccurately extracts subdomain, domain, and…
permissive · top 1,000 on PyPI
publicsuffix2Extracts the public suffix and registrable…
copyleft · top 5,000 on PyPI
dnstwistGenerates domain name permutations to detect…
permissive · top 15,000 on PyPI
tldparseParses domain names into their constituent…
permissive · top 15,000 on PyPI
whoisRetrieves WHOIS information for domain names by…
permissive · top 15,000 on PyPI
publicsuffixlistParses the Public Suffix List to extract the…
copyleft · top 5,000 on PyPI
free-email-domainsProvides a curated list of free email domains…
permissive · top 5,000 on PyPI
urlextractExtracts URLs from text by locating TLDs and…
permissive · top 5,000 on PyPI
language-tagsValidates and parses IANA language tags…
permissive · top 5,000 on PyPI