Skip to main content

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.

The Python module ships with a (possibly out-dated) copy of the Public Suffix List so that it is usable out of the box. It’s up the user to keep it up-to-date with the most recent version of the list available on http://publicsuffix.org

Module content

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

>>> from publicsuffix import PublicSuffixList
>>> 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 http://www.tablix.org/~avian/git/publicsuffix.git

Metadata

Release files for publicsuffix 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for publicsuffix 1.0.3
File Size Uploaded Provenance Actions
publicsuffix-1.0.3.tar.gz 38.9 kB Without provenance Details for publicsuffix-1.0.3.tar.gz

Release files / publicsuffix-1.0.3.tar.gz

Download URL publicsuffix-1.0.3.tar.gz
Size 38.9 kB
Tags Source
SHA-256 checksum
How to use checksums
90c9af65b1a8657da619e34dcdd195daa70deb501e4bea26a7539feb05a39aae
BLAKE2b-256 checksum
How to use checksums
395bbff980a6c434fe4016718cfff79e3eff948f0d93eab50dd9a521748aa249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for publicsuffix 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page