Skip to content
forked from jpverkamp/etld

Effective TLD parsing library for Python

Notifications You must be signed in to change notification settings

BobbyAtCore/etld

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Split hostnames to domain and effective TLD.

Based on Mozilla's effective TLD file found here (automatically downloaded on first run): https://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1

Examples:

example.com           => ('example', 'com')   # Test com TLD
sub.example.com       => ('example', 'com')
sub.dub.example.com   => ('example', 'com')
example.co.uk         => ('example', 'co.uk') # Test *.uk eTLD
sub.example.co.uk     => ('example', 'co.uk')
sub.dub.example.co.uk => ('example', 'co.uk')
bl.uk                 => ('bl', 'uk')         # Exception to the normal *.uk 
example.frog          => None                 # Return None on invalid TLDs

About

Effective TLD parsing library for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%