{"repo":"john-kurkowski/tldextract","free":true,"listed":false,"github":"https://github.com/john-kurkowski/tldextract","clone":"git clone https://github.com/john-kurkowski/tldextract.git","description":"Accurately separates a URL’s subdomain, domain, and public suffix, using the Public Suffix List (PSL).","language":"Python","stars":2013,"topics":["python","tldextract","country-codes","suffix","tld","publicsuffix","publicsuffixlist"],"license":"BSD-3-Clause","category":"cli-tools","readme_excerpt":"tldextract tldextract accurately separates a URL's subdomain, domain, and public suffix, using the Public Suffix List (PSL). Why? Naive URL parsing like splitting on dots fails for domains like forums.bbc.co.uk (gives \"co\" instead of \"bbc\"). tldextract handles the edge cases, so you don't have to. Quick Start Install How-to Guides How to disable HTTP suffix list fetching for production How to set a custom cache location Via environment variable: Or in code: How to update TLD definitions Command line: Or delete the cache folder: How to treat private domains as suffixes How to use a local suffix list How to use a remote suffix list How to add extra suffixes How to validate URLs before extraction Command Line Understanding Domain Parsing Public Suffix List tldextract uses the Public Suffix List, a community-maintained list of domain suffixes. The PSL contains both: - Public suffixes : Where anyone can register a domain ( .com , .co.uk , .org.kg ) - Private suffixes : Operated by companies for customer subdomains ( blogspot.com , github.io ) Web browsers use this same list for security decisions like cookie scoping. Suffix vs. TLD While .com is a top-level domain (TLD), many suffixes like .co.uk are technically second-level. The PSL uses \"public suffix\" to cover both. Default behavior with private domains By default, tldextract treats private suffixes as regular domains: To treat them as suffixes instead, see How to treat private domains as suffixes. Default behavior with unliste","default_branch":null,"files":null,"tree":[],"storefront":"/r/john-kurkowski","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/john-kurkowski/tldextract/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}