×

tldextract accurately separates a URL's subdomain, domain, and public suffix, using the Public Suffix List (PSL). Say you want just the "google" part of https://www.google.com. Everybody gets this wrong. Splitting on the "." and taking the 2nd-to-last element only works for simple domains, e.g. .com. Consider http://forums.bbc.co.uk: the naive splitting method will give you "co" as the domain, instead of "bbc". Rather than juggle TLDs, gTLDs, or ccTLDs yourself, tldextract extracts the currently living public suffixes according to the Public Suffix List. A public suffix is also sometimes called an effective TLD (eTLD).

Uploaded Tue Apr 1 00:31:49 2025
md5 checksum 57d7cdb878186d67a2ab5e0db324964c
arch x86_64
build py312h06a4308_0
depends filelock >=3.0.8, idna, python >=3.12,<3.13.0a0, requests >=2.1.0, requests-file >=1.4
license BSD-3-Clause
license_family BSD
md5 57d7cdb878186d67a2ab5e0db324964c
name tldextract
platform linux
sha1 45996b072ea8eeb972b7c28b658bab9587f2cdea
sha256 17a8b6d4fbf9c13716e500d54bb87cec69f45d14b53881ad847cc91c63a9b225
size 125748
subdir linux-64
timestamp 1723064411963
version 5.1.2