Skip to main content

Proper domain parser using TLD info from publicsuffix.org

Project description

Python domain-parser

Parse domains using the TLD list maintained by publicsuffix.org.

Domains are parsed into their TLD, SLD, and subdomains. TLDs like ‘co.uk’ are handled properly. The list of possible TLDs is generated from publicsuffix.org. The first time the library is run, an HTTP request is made and a .tld.pickle file is created. Subsequent runs don’t make an HTTP request. Rather, they load the pickle file. If you want to refresh the list, simply delete the pickle file.

TODO

There are tests, but not enough. I’m hoping that if people find this useful they’ll contribute test cases to the projects.

New in version 0.0.4

  • Use pylru and TLD_CACHE to speed up parsing in long-running programs

Project details


Download files

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

Source Distribution

domain_parser-0.0.5.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file domain_parser-0.0.5.tar.gz.

File metadata

  • Download URL: domain_parser-0.0.5.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for domain_parser-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a33bf7c6a712c5b894a89689a2bc200f007388a8b67e777b673d26ca214f433a
MD5 57b7481b23ecf7a1fc9895934b54cc24
BLAKE2b-256 287f73f47d710fc0e6cbd9ac2cb1d2b9eeb58661df6608b01f98a66f77f01437

See more details on using hashes here.

Supported by

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