Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    tldextract 1.1.2

    Download button

    No screenshots available
    Downloads: 241  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    John Kurkowski | More programs
    BSD License / FREE
    September 19th, 2012, 19:59 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    tldextract description

    Accurately separate the gTLD/ccTLD component from the registered domain and subdomains of a URL.

    tldextract is a Python module that accurately separates the gTLD and ccTLDs from the registered domain and subdomains of a URL. For example, you may want the 'www.google' part of http://www.google.com. This is simple to do by splitting on the '.' and using all but the last split element, however that will not work for URLs with arbitrary numbers of subdomains and country codes, unless you know what all country codes look like. Think http://forums.bbc.co.uk for example.

    tldextract can give you the subdomains, domain, and gTLD/ccTLD component of a URL, because it looks up--and caches locally--the currently living TLDs according to iana.org.

     >>> import tldextract
     >>> ext = tldextract.extract('http://forums.news.cnn.com/')
     >>> ext['subdomain'], ext['domain'], ext['tld']
     ('forums.news', 'cnn', 'com')
     >>> ext = tldextract.extract('http://forums.bbc.co.uk/')
     >>> ext['subdomain'], ext['domain'], ext['tld']
     ('forums', 'bbc', 'co.uk')



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    ccTLD separator | gTLD separator | gTLD | ccTLD | separator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM