publicsuffixlist
publicsuffixlist implement
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has zero known vulnerabilities, installs with no friction, and solves a well-defined problem that many applications need. The copyleft license (MPL 2.0) is permissible for most use cases as long as modifications are disclosed. Install it if you need reliable public suffix parsing; the daily-updated built-in list and pure-Python implementation make it a practical choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.5 or later; Python 2.7 and 3.4 are no longer supported.
- Low friction: pure Python with no runtime dependencies, distributed as a wheel.
- Actively maintained with a release 19 days ago; last commit on 2026-07-26.
License · maintenance · safety
MPL-2.0 (copyleft) — Licensed under Mozilla Public License 2.0 (copyleft). Requires derivative works and modifications to be disclosed under the same license; permissible for proprietary use if license terms are respected.
last release 2026-07-26 (19 days) · last repo commit 2026-07-26 · 80 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,813,995 downloads/mo, #3,525 on PyPI
Alternatives
Verify before relying
from publicsuffixlist import PublicSuffixList
psl = PublicSuffixList()
print(psl.publicsuffix("www.example.com")) # "com"
print(psl.privatesuffix("www.example.com")) # "example.com"- Whether the built-in PSL file is updated daily as claimed, or how frequently updates occur in practice.
- Performance characteristics when parsing very large domain lists or with deeply nested subdomains.
What it is and what it does
publicsuffixlist is a pure-Python parser for the Public Suffix List, a Mozilla-maintained registry of domain suffixes (like .com, .co.uk, and many others). It determines what portion of a domain name is the public suffix and what portion is privately registrable—useful for cookie handling, domain validation, and security contexts where you need to know the "effective" domain of a given hostname.
The package ships with a built-in, daily-updated PSL file and supports both Unicode and Punycode-encoded internationalized domain names (IDNs). It has no external dependencies, installs as a wheel, and includes an updater script if you need to use a custom PSL file. The API is straightforward: call `publicsuffix()` to get the longest public suffix, `privatesuffix()` to get the shortest registrable domain, and helper methods like `is_private()` and `subdomain()` for common tasks.
Use it for
- Determine the registrable domain from a URL to enforce same-site cookie policies or security boundaries.
- Extract the effective domain from a list of hostnames for analytics or logging aggregation.
- Validate whether a given domain is a known public suffix (e.g., to reject registrations at the TLD level).
- Handle internationalized domain names in Unicode or Punycode form without manual encoding logic.
- Parse domain hierarchies to identify subdomains and their relationship to the registrable domain.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has zero known vulnerabilities, installs with no friction, and solves a well-defined problem that many applications need. The copyleft license (MPL 2.0) is permissible for most use cases as long as modifications are disclosed. Install it if you need reliable public suffix parsing; the daily-updated built-in list and pure-Python implementation make it a practical choice.
Install
publicsuffixlist on PyPI
Before you install
Low friction: pure Python with no runtime dependencies, distributed as a wheel. Actively maintained with a release 19 days ago; last commit on 2026-07-26. Dropped Python 2.7 and 3.4 support at version 1.0.0 in June 2024.
Requires Python 3.5 or later; Python 2.7 and 3.4 are no longer supported.
License in practice
Licensed under Mozilla Public License 2.0 (copyleft). Requires derivative works and modifications to be disclosed under the same license; permissible for proprietary use if license terms are respected.
Quickstart
from publicsuffixlist import PublicSuffixList
psl = PublicSuffixList()
print(psl.publicsuffix("www.example.com")) # "com"
print(psl.privatesuffix("www.example.com")) # "example.com"
Verify before relying
- Whether the built-in PSL file is updated daily as claimed, or how frequently updates occur in practice.
- Performance characteristics when parsing very large domain lists or with deeply nested subdomains.
Package facts
| License | MPL-2.0 copyleft |
| Python support | Supports the current Python release >=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 19 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,813,995 / month, #3,525 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Operating System :: OS IndependentTopic :: Internet :: Name Service (DNS)Topic :: Text Processing :: Filters |
Evidence: publicsuffixlist-1.0.2.20260726-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “public suffix list parser”
- publicsuffixlistParses the Public Suffix List to extract the public and private…
- publicsuffix2Extracts the public suffix and registrable domain from a domain name…
- tldExtracts the top-level domain (TLD) and first-level domain (FLD) from…
Give your agent the search over MCP, or paste the wish link into any chat.
More Filters packages
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Converts Markdown text to HTML using a Python implementation of John Gruber's Markdown specification, with support for extensions.
Install it if you need to parse Markdown in Python.
NLTK is a Python library for natural language processing tasks including tokenization, parsing, tagging, and linguistic analysis, with built-in datasets and educational resources.
Install it if you need foundational NLP tools, linguistic datasets, or are learning the field; consider specialized libraries (spaCy, transformers) if you need…
Provides Python utilities for writing pandoc filters that transform document ASTs by reading JSON from stdin, modifying the structure, and writing JSON to stdout.
Converts Unicode text to ASCII-safe representations by transliterating non-ASCII characters to their closest ASCII equivalents, useful for generating URL slugs, legacy system integration, and keyboard-friendly identifiers.
Install it if you need lossy Unicode-to-ASCII conversion and can accept GPLv2+ copyleft terms.
Pymdown Extensions provides a collection of additional extensions for Python Markdown that add syntax support for advanced formatting, including tabbed content, superfences with syntax highlighting, emoji, and other markup enhancements.
Install it if you need markdown features beyond the standard library.
See also publicsuffix2 · tldextract · idna · domain2idna · ioc-fanger · tlds · tld · tldparse · python-whois · atpublic