How to use the tldextract.tldextract.TLD_EXTRACTOR.tlds function in tldextract

To help you get started, we’ve selected a few tldextract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github john-kurkowski / tldextract / tldextract_app / handlers.py View on Github external
def GET(self):  # pylint: disable=invalid-name,no-self-use
        web.header('Content-Type', 'text/html; charset=utf-8')
        return '<br>'.join(sorted(tldextract.tldextract.TLD_EXTRACTOR.tlds))
github kootenpv / tok / tok / __init__.py View on Github external
def add_domain_handler(self):
        import re
        from tldextract.tldextract import TLD_EXTRACTOR

        valid_re = re.compile("^[a-zA-Z.]+$")
        tlds = ["." + x for x in TLD_EXTRACTOR.tlds if valid_re.match(x)]

        for x in tlds:
            self.add(x, x, "Added by domain handler, keeps the token existing.")

tldextract

Accurately 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.

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

88 / 100
Full package analysis

Similar packages