--- id: tldparse version: "1.0.5" license: MIT license_treatment: permissive maintenance: dormant --- # tldparse — Parse a given domain and split it into its subdomain, domain and top-level domain parts. License: permissive · Maintenance: dormant · Downloads: 101.0K/mo ## What it is and what it does TLDParse is a domain name parser that breaks a domain into its three core parts: subdomain, domain name, and top-level domain (suffix). It uses the Mozilla public suffix list to correctly handle multi-part TLDs like .co.uk, and works by parsing from right to left (TLD first) rather than left to right. The library has no external runtime dependencies and supports Python 3.3 through 3.10 as well as PyPy. You instantiate a DomainResult object with a domain string (with or without a URL scheme or path) and access properties like `.tld`, `.domain`, `.subdomain`, and `.fqdn` (fully qualified domain name). You can also customize parsing behavior by passing a `private` parameter to control whether certain domains like github.io are treated as registrable domains or private suffixes, or by providing your own parser implementation. Use it for: - Validate email domains by checking whether they contain subdomains, rejecting registrations from subdomain addresses. - Extract the registrable domain from a URL to group analytics or logs by the actual domain owner rather than subdomains. - Identify and separate multi-part TLDs (e.g., .co.uk, .com.au) correctly when building domain-based access controls or filtering. - Customize TLD handling for internal or private domain suffixes by adding or removing entries from the parser. - Parse domains from user input in web scraping or security scanning tools to normalize and categorize targets. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses domain names into their constituent parts (subdomain, domain, top-level domain) by working backwards from the TLD, with support for multi-part suffixes like .co.uk. Yes, if you need reliable domain parsing with multi-part TLD support and can tolerate dormant maintenance. The package is dependency-free, permissively licensed, and marked stable. However, do not use it if you require active bug fixes or expect frequent TLD updates—the repository shows minimal ongoing support. ## Install pip install tldparse uv add tldparse poetry add tldparse ## Installing tldparse Before you install: Low install friction with no runtime dependencies. Dormant maintenance status (last commit 2024-10-25) means bug fixes or updates are unlikely, though the package is marked Production/Stable. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, requiring only attribution and inclusion of the license notice. Quickstart: pip install tldparse from tldparse import DomainResult parsed = DomainResult('https://example.github.io/with/some/path') print(parsed.tld) # io print(parsed.domain) # github print(parsed.subdomain) # example Verify before relying: - Whether the Mozilla public suffix list bundled with the package is kept current or requires manual updates. - Performance characteristics ('very fast') compared to other domain parsing libraries in real-world scenarios. - Whether dormant status means the package will handle edge cases or new TLDs introduced after 2024-10-25. - Repository activity level (stars, contributor count) and likelihood of future maintenance. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 101.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags domain name parser, split domain into parts, extract tld from domain, subdomain extraction, parse fqdn, tld parsing library, domain suffix resolver, domain-parsing, tld-extraction [View on SkillFed](https://skillfed.io/packages/tldparse) · [View on PyPI](https://pypi.org/project/tldparse/)