Skip to main content

Get a public suffix for a domain name using the Public Suffix List.

Project description

This module allows you to get the public suffix of a domain name using the Public Suffix List from http://publicsuffix.org

A public suffix is one under which Internet users can directly register names. Some examples of public suffixes are .com, .co.uk and pvt.k12.wy.us. Accurately knowing the public suffix of a domain is useful when handling web browser cookies, highlighting the most important part of a domain name in a user interface or sorting URLs by web site.

Module content

The module exports a class that parses the Public Suffix List and allows queries for individual domain names:

>>> psl = PublicSuffixList()
>>> psl.get_public_suffix("www.example.com")
'example.com'

Please note that the host part of an URL can contain strings that are not plain DNS domain names (IP addresses, Punycode-encoded names, name in combination with a port number or an username, etc.). It is up to the caller to ensure only domain names are passed to the get_public_suffix() method.

Source

You can get a local copy of the development repository with:

git clone git clone http://www.tablix.org/~avian/git/publicsuffix.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publicsuffix-1.0.0.tar.gz (28.7 kB view details)

Uploaded Source

File details

Details for the file publicsuffix-1.0.0.tar.gz.

File metadata

  • Download URL: publicsuffix-1.0.0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for publicsuffix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 398a92db14269ed68bb83a94c9d61420fb9d349faf915a6c8d09bf17d6d54cf4
MD5 d0cbe3bbf20328c290523a282686a0b4
BLAKE2b-256 aa566d04db58a5a8dd7ef5557018ade7210bb27a21c82ce347bd71b06074adae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page