Skip to content

onlinemediagroup/publicsuffix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 branch is maintained by MixRank, we reimplemented it using a different data structure (a prefix tree) in order to improve performance.

Usage

You will need to download the list yourself.

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

Find the registered domain:

>>> publicsuffix.init_suffix_tree('names.dat')
>>> publicsuffix.domain('www.python.org')
u'python.org'

About

Python interface to the Public Suffix List

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%