×

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 fa25ac196403d3bb27b5843b851cee8e
arch x86_64
build py310h06a4308_0
depends filelock >=3.0.8, idna, python >=3.10,<3.11.0a0, requests >=2.1.0, requests-file >=1.4
license BSD-3-Clause
license_family BSD
md5 fa25ac196403d3bb27b5843b851cee8e
name tldextract
platform linux
sha1 35eb0167e528f01ce47e3d77489307bb35e36319
sha256 76aa077669e24d071329fffb0639589f057684a55187d526e854a68cf28c1109
size 120055
subdir linux-64
timestamp 1723064440165
version 5.1.2