Comparison
publicsuffix2 vs tld vs tldextract
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Get a public suffix for a domain name using the Public Suffix List. Forked from and using the same API as the publicsuffix package.
Likely abandoned. No release or commit for years (last release over 6 years ago).
pip install publicsuffix2Extract the top-level domain (TLD) from the URL given.
Maintained. Last release 9 months ago, commits in 1 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 3 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install tldextractIn short
- publicsuffix2 looks abandoned: avoid it for new projects.
- tldextract is the most used: 41.1M downloads a month, 2.1× more than tld.
- tldextract also has the best Pythie’s Index (58).
Side by side
| Metric | publicsuffix2 | tld | tldextract |
|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 21 | 40 |