$npx skillfedfor your agent

publicsuffix2

Get a public suffix for a domain name using the Public Suffix List. Forked from and using the same API as the publicsuffix package.

With conditionsPyPI UtilitiesReleased Dec 20197.6M downloads / moMIT and MPL-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — publicsuffix2-2.20191221-py2.py3-none-any.whl
v2.20191221 · released 2019-12-21

Yes, if your domain processing needs are static or historical. The package has no dependencies, low install friction, and a stable API. However, do not use it if you require current public suffix data—the bundled list is from 2019-12-21 and the project is abandoned. Use fetch() to pull the latest list at runtime, or consider an actively maintained alternative if freshness is critical.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • The bundled Public Suffix List data is from 2019-12-21 and will not reflect newer public suffixes; use fetch() to download the latest list if current data is critical.
  • Low install friction with no runtime dependencies.
  • However, the package is abandoned—last commit was 2021-11-02 and no releases since 2019-12-21.

License · maintenance · safety

MIT and MPL-2.0 (copyleft) — Dual-licensed under MIT and MPL-2.0 (copyleft). The code is MIT-licensed but the bundled Public Suffix List data is MPL-2.0-licensed, which imposes copyleft obligations on derivative works of the data.

last release 2019-12-21 (2428 days) · last repo commit 2021-11-02 · 30 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,588,428 downloads/mo, #1,718 on PyPI

Verify before relying

pip install publicsuffix2

from publicsuffix2 import get_public_suffix
result = get_public_suffix('www.example.co.uk')
# result: 'example.co.uk'
  • Whether the stale bundled PSL (from 2019-12-21) is acceptable for your domain processing use case.
  • Performance characteristics of the Trie-based implementation in your specific workload or scale.
Same gist for agents: .md · .json

What it is and what it does

publicsuffix2 is a Python module that parses domain names against the Public Suffix List to identify the public suffix (effective TLD) and registrable domain. It builds the PSL as a Trie structure for efficient lookup, making it suitable for large-scale processing. The module comes bundled with a copy of the PSL so it works out of the box, though that data is from 2019-12-21.

The package supports several query modes: extracting the registrable domain (base domain), returning only the effective TLD, handling IDNA-encoded domains, ignoring wildcards for aggregation, and strict validation to reject domains with invalid TLDs. It exposes both convenience functions (get_public_suffix, get_sld, get_tld) and a PublicSuffixList class for finer control. However, the project is abandoned—no releases or commits since late 2021—so the bundled data will not reflect newly added public suffixes.

Use it for

  • Extract the registrable domain from a URL for web browser cookie scope management.
  • Identify the effective TLD of a domain to highlight the most important part in a user interface.
  • Aggregate and sort URLs by website in large-scale domain processing or DNS research.
  • Validate that a domain includes a recognized public suffix using strict mode.
  • Handle internationalized domain names (IDN) by toggling IDNA encoding on or off.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if your domain processing needs are static or historical.

The package has no dependencies, low install friction, and a stable API. However, do not use it if you require current public suffix data—the bundled list is from 2019-12-21 and the project is abandoned. Use fetch() to pull the latest list at runtime, or consider an actively maintained alternative if freshness is critical.

Install

publicsuffix2 on PyPI

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last commit was 2021-11-02 and no releases since 2019-12-21. The Public Suffix List data bundled with the package will become stale over time.

The bundled Public Suffix List data is from 2019-12-21 and will not reflect newer public suffixes; use fetch() to download the latest list if current data is critical.

License in practice

Dual-licensed under MIT and MPL-2.0 (copyleft). The code is MIT-licensed but the bundled Public Suffix List data is MPL-2.0-licensed, which imposes copyleft obligations on derivative works of the data.

Quickstart

pip install publicsuffix2

from publicsuffix2 import get_public_suffix
result = get_public_suffix('www.example.co.uk')
# result: 'example.co.uk'

Verify before relying

  • Whether the stale bundled PSL (from 2019-12-21) is acceptable for your domain processing use case.
  • Performance characteristics of the Trie-based implementation in your specific workload or scale.

Package facts

LicenseMIT and MPL-2.0 copyleft
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAbandoned 2,428 days since the last release
Last repo commit
First released
Downloads7,588,428 / month, #1,718 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Internet :: Name Service (DNS)Topic :: Utilities

Evidence: publicsuffix2-2.20191221-py2.py3-none-any.whl

Tags

Capabilities
public suffix list parserextract registrable domaindomain name parsingtld extractionetld lookupdomain cookie handlingdns domain analysis
Topics
domain-parsingpsl-lookupdns-utilities
PyPI keywords
domainpublic suffixsuffixdnstldsldpslidna

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 › “etld lookup”

  • publicsuffix2Extracts the public suffix and registrable domain from a domain name…
  • pyasnpyasn performs fast offline IP address to Autonomous System Number…
  • reverse-geocodeReverse Geocode converts latitude/longitude coordinates to the…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

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.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also publicsuffixlist · tlds · tldextract · tld · dnstwist · tldparse · domain2idna · python-whois · whois