Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python interface to the Public Suffix List
Python
branch: master

This branch is 22 commits ahead of onlinemediagroup:master

Merge pull request #1 from rboulton/0.3

Update version number for new release
latest commit 5794e379d8
@rboulton authored

README.rst

fastpublicsuffix

This module provides a Python interface to the Public Suffix List.

The Public Suffix List (PSL) is a set of rules describing "effective top-level domains" and can be used to determine the registered domain for a given host name.

This module is maintained by Richard Boulton, based on a fork of a module from MixRank.

Usage

You can download the list yourself, or use the version distributed along with the module.

Call the init_suffix_tree function. Then call get_root_domain to find the registered domain. This branch does not support asking for the (E)TLD.

Find the registered domain:

>>> fastpublicsuffix.init_suffix_tree()
>>> fastpublicsuffix.domain('www.python.org')
u'python.org'
Something went wrong with that request. Please try again.