Comparison
tld vs tldextract
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Extract the top-level domain (TLD) from the URL given.
Maintained. Last release 9 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
$
pip install tldAccurately separates a URL's subdomain, domain, and public suffix, using the Public Suffix List (PSL). By default, this includes the public ICANN TLDs and their exceptions. You can optionally support the Public Suffix List's private domains as well.
Maintained. Last release 8 weeks ago, commits in 6 of the last 26 weeks. Weaker on contributor spread.
$
pip install tldextractIn short
- tldextract is the most used: 41.9M downloads a month, 2.1× more than tld.
- tldextract also has the best Pythie’s Index (64).
- Safe default for a new project: tldextract.
Side by side
| Metric | tld | tldextract |
|---|---|---|
| Pythie’s Index | Pythie’s Index: 42 | 64 |