Comparison
publicsuffix2 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 publicsuffix2Accurately 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
- publicsuffix2 looks abandoned: avoid it for new projects.
- tldextract is the most used: 41.9M downloads a month, 7.6× more than publicsuffix2.
- tldextract also has the best Pythie’s Index (64).
- Safe default for a new project: tldextract.
Side by side
| Metric | publicsuffix2 | tldextract |
|---|---|---|
| Pythie’s Index | Pythie’s Index: 21 | 64 |