VOOZH about

URL: https://pypi.org/project/tldextract/1.4/

⇱ tldextract Β· PyPI


Skip to main content

tldextract 1.4

pip install tldextract==1.4

Newer version available (5.3.1)

Released:

Accurately separate the TLD from the registered domain and subdomains of a URL, using the Public Suffix List.

Navigation

Verified details

These details have been verified by PyPI
Maintainers
πŸ‘ Avatar for John.Kurkowski from gravatar.com
John.Kurkowski

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: BSD License (BSD License)
  • Author: John Kurkowski
  • Tags tld , domain , subdomain , url , parse , extract , urlparse , urlsplit , public , suffix , list

Project description

tldextract accurately separates the gTLD or ccTLD (generic or country code top-level domain) from the registered domain and subdomains of a URL.

>>> import tldextract
>>> tldextract.extract('http://forums.news.cnn.com/')
ExtractResult(subdomain='forums.news', domain='cnn', suffix='com')
>>> tldextract.extract('http://forums.bbc.co.uk/') # United Kingdom
ExtractResult(subdomain='forums', domain='bbc', suffix='co.uk')
>>> tldextract.extract('http://www.worldbank.org.kg/') # Kyrgyzstan
ExtractResult(subdomain='www', domain='worldbank', suffix='org.kg')

ExtractResult is a namedtuple, so it’s simple to access the parts you want.

>>> ext = tldextract.extract('http://forums.bbc.co.uk')
>>> ext.domain
'bbc'
>>> '.'.join(ext[:2]) # rejoin subdomain and domain
'forums.bbc'

Project details

Verified details

These details have been verified by PyPI
Maintainers
πŸ‘ Avatar for John.Kurkowski from gravatar.com
John.Kurkowski

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: BSD License (BSD License)
  • Author: John Kurkowski
  • Tags tld , domain , subdomain , url , parse , extract , urlparse , urlsplit , public , suffix , list

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tldextract-1.4.tar.gz (58.0 kB view details)

Uploaded Source

File details

Details for the file tldextract-1.4.tar.gz.

File metadata

  • Download URL: tldextract-1.4.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tldextract-1.4.tar.gz
Algorithm Hash digest
SHA256 fc03ebfda423827ee643691329d5961872274cfbbd9a08be125fc1cc79160287
MD5 19ed26cb35fb057da822f3d4d2380805
BLAKE2b-256 8ebc0e03784041ce1b5e5c2d4d9e8ceea7fce360403984a754f8f49f56d90463

See more details on using hashes here.

Supported by

πŸ‘ Image
AWS Cloud computing and Security Sponsor πŸ‘ Image
Datadog Monitoring πŸ‘ Image
Depot Continuous Integration πŸ‘ Image
Fastly CDN πŸ‘ Image
Google Download Analytics πŸ‘ Image
Pingdom Monitoring πŸ‘ Image
Sentry Error logging πŸ‘ Image
StatusPage Status page