Skip to main content

Logo

A blazingly fast domain extraction library written in Rust

license Python Build PyPi

Table of Contents

About The Project

PyDomainExtractor is a Python library designed to parse domain names quickly. In order to achieve the highest performance possible, the library was written in Rust.

Built With

Performance

Extract From Domain

Tests were run on a file containing 10 million random domains from various top-level domains (Mar. 13rd 2022)

Library Function Time
PyDomainExtractor pydomainextractor.extract 1.50s
publicsuffix2 publicsuffix2.get_sld 9.92s
tldextract __call__ 29.23s
tld tld.parse_tld 34.48s

Extract From URL

The test was conducted on a file containing 1 million random urls (Mar. 13rd 2022)

Library Function Time
PyDomainExtractor pydomainextractor.extract_from_url 2.24s
publicsuffix2 publicsuffix2.get_sld 10.84s
tldextract __call__ 36.04s
tld tld.parse_tld 57.87s

Installation

pip3 install PyDomainExtractor

Usage

Extraction

import pydomainextractor


# Loads the current supplied version of PublicSuffixList from the repository. Does not download any data.
domain_extractor = pydomainextractor.DomainExtractor()

domain_extractor.extract('google.com')
>>> {
>>>     'subdomain': '',
>>>     'domain': 'google',
>>>     'suffix': 'com'
>>> }

# Loads a custom SuffixList data. Should follow PublicSuffixList's format.
domain_extractor = pydomainextractor.DomainExtractor(
    'tld\n'
    'custom.tld\n'
)

domain_extractor.extract('google.com')
>>> {
>>>     'subdomain': 'google',
>>>     'domain': 'com',
>>>     'suffix': ''
>>> }

domain_extractor.extract('google.custom.tld')
>>> {
>>>     'subdomain': '',
>>>     'domain': 'google',
>>>     'suffix': 'custom.tld'
>>> }

URL Extraction

import pydomainextractor


# Loads the current supplied version of PublicSuffixList from the repository. Does not download any data.
domain_extractor = pydomainextractor.DomainExtractor()

domain_extractor.extract_from_url('http://google.com/')
>>> {
>>>     'subdomain': '',
>>>     'domain': 'google',
>>>     'suffix': 'com'
>>> }

Validation

import pydomainextractor


# Loads the current supplied version of PublicSuffixList from the repository. Does not download any data.
domain_extractor = pydomainextractor.DomainExtractor()

domain_extractor.is_valid_domain('google.com')
>>> True

domain_extractor.is_valid_domain('domain.اتصالات')
>>> True

domain_extractor.is_valid_domain('xn--mgbaakc7dvf.xn--mgbaakc7dvf')
>>> True

domain_extractor.is_valid_domain('domain-.com')
>>> False

domain_extractor.is_valid_domain('-sub.domain.com')
>>> False

domain_extractor.is_valid_domain('\xF0\x9F\x98\x81nonalphanum.com')
>>> False

TLDs List

import pydomainextractor


# Loads the current supplied version of PublicSuffixList from the repository. Does not download any data.
domain_extractor = pydomainextractor.DomainExtractor()

domain_extractor.get_tld_list()
>>> [
>>>     'bostik',
>>>     'backyards.banzaicloud.io',
>>>     'biz.bb',
>>>     ...
>>> ]

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Gal Ben David - gal@intsights.com

Project Link: https://github.com/Intsights/PyDomainExtractor

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pydomainextractor-0.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pydomainextractor-0.14.0-cp313-cp313-macosx_11_0_arm64.whl (399.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pydomainextractor-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl (367.0 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

pydomainextractor-0.14.0-cp313-cp313-macosx_10_7_x86_64.whl (412.0 kB view details)

Uploaded CPython 3.13macOS 10.7+ x86-64

pydomainextractor-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pydomainextractor-0.14.0-cp312-cp312-macosx_11_0_arm64.whl (399.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pydomainextractor-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl (367.0 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

pydomainextractor-0.14.0-cp312-cp312-macosx_10_7_x86_64.whl (411.9 kB view details)

Uploaded CPython 3.12macOS 10.7+ x86-64

pydomainextractor-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pydomainextractor-0.14.0-cp311-cp311-macosx_11_0_arm64.whl (399.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pydomainextractor-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl (367.5 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

pydomainextractor-0.14.0-cp311-cp311-macosx_10_7_x86_64.whl (411.8 kB view details)

Uploaded CPython 3.11macOS 10.7+ x86-64

pydomainextractor-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pydomainextractor-0.14.0-cp310-cp310-macosx_11_0_arm64.whl (399.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pydomainextractor-0.14.0-cp310-cp310-macosx_10_12_x86_64.whl (367.7 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

pydomainextractor-0.14.0-cp310-cp310-macosx_10_7_x86_64.whl (411.8 kB view details)

Uploaded CPython 3.10macOS 10.7+ x86-64

File details

Details for the file pydomainextractor-0.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18282096fdad2c02d3818cecc899d1d2956711fb5a7af6005df1b79227ba7288
MD5 c5bf1ac51fa6c7cafe7b6c956d54fee1
BLAKE2b-256 574dfdad15621d3f5c126bea835d03a4234e3b9437e6d38886c8fb59b8575885

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7075b799f0dbdf3032d549f06fa6f7376d0c59ac7195a32c5434a0cdf3e4e4f
MD5 573a16d477241a6b47738937cb695fbd
BLAKE2b-256 840f2d84e2fd7db7b60f3738866a1a5d2135b19cf2c58033ec7afdafc7d34fe8

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6bcff0579e20498a5fdaee38805485ea17173a11a49ebcf82af5687b66dbda17
MD5 65d52ac0485ddb82fc07174af95c1286
BLAKE2b-256 35e7c05546ce06681a3f1d62204bf83a7ca1d57f9898abfa50a7a4a0a26b60b7

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp313-cp313-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp313-cp313-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 0b0a7f6a7d572aeea8c214f97496333b05dabe9bfb3042dba30e5a6dc4be1e87
MD5 3e90fdead478e0a261211f22de5f1cfe
BLAKE2b-256 80ac4a8378915c2e8a80fc159c3533ee092b2a5288ffe2eda7785d1bb85c4a31

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b5483edcadfdd13bc18650721de40f2f3b8e1e2f540374f1eb7784c8d62ac9b
MD5 a3d280aa5ace92b795b6783d93c126f9
BLAKE2b-256 0e1e1721f0639861bc7ef2a714b64dca5df4120a09f9a62f614e4fa0146ec1c7

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 acf205a5cf88d86d02082638635a4557108f79e3dafa7c550a8fc3656a956f01
MD5 a75beb984ee88b02d6a050c490ea849c
BLAKE2b-256 e9168998d6a2115bc4b2ba17ccd51715f7e8e3c584f9ec76600420a2abd1d3f2

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0e82256f4249b0d04e9270fe4c79364f0b485d5778c90e4109d1fb9f7b0383cd
MD5 2b801e8155e9b8f42af90627216abb35
BLAKE2b-256 955b529146f34341a48756fef3e3366ee07be0de94874c1b2ae1b11092cbb6df

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp312-cp312-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp312-cp312-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 3ae576f818bef89060ff4eb314240d743096ac3e2f163efb1b19ea80a4fdbddd
MD5 930290c821b091359d1bf79b560dc691
BLAKE2b-256 8ab59990a2c6d9a9da4530f3d7ac6f21a84565db7e5a7d88a7c149404a2b5035

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd4c13fa2764e8405bbb54dd56ce4421a43ba69aa0e7ac826f3512250801bff3
MD5 cfd21f4566c5eb9a0f0aeaf30456c665
BLAKE2b-256 f11bc32bda7e230d3e37b0efadebd4a7a77f86ebbb4daaff7544b50a3108c780

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 450563f67d438dab695fb371590a5b4aaa30ad7f2b856ccab3f60077765a27ff
MD5 5fdc77b4139afd49555207562ca98776
BLAKE2b-256 53e33849fe785d42ea2397acb0ff7a8db9efad0ef1a6996dde5d20be95b72859

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 11d38fa475fad6eccb2f67c9c8cbf99a6cce165e9294d5c6e80915b05abb1e13
MD5 e05d56567094f732fdad6d9d4b6aae64
BLAKE2b-256 7713ac0d60c170cd275b4143925d4dad0451c27127705e318a662677001cdb69

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c91efff5ba3ea89fde0cf16dfcdba8c44f3f8536826ad000291825153c6d5dec
MD5 ce4c422ac1f4ed79be2065780cd1e8c9
BLAKE2b-256 c9867dbbf8f53e30625577271d37d49d123ce16fe725a307f173103df08aa254

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3e9ce3ab0e222b9590847cac6712c5f10bfe286fa1824adc697be9d4a7b03fa
MD5 2d3d3a8e37b8858e352d695502730657
BLAKE2b-256 a29201f21e264516e1a040602699f38eed458c71ae562a7e6e37f53597593a13

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2379f9d04ce4c58ee0d66eda49a959304c09fa97745bb69224ec8ef65488227b
MD5 d635714c4a175e92afbcc0ea91f2322e
BLAKE2b-256 88f2ffb69db942dd0fc62069ca5d9aca9958622630b17569dec0eb7c936e1321

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dbc1893dd77e147bf94753e04c26f436d9be08eb8468c8ba76bf7fe87192fa2b
MD5 a81cfd0af7edb0387b9af816f8f20a83
BLAKE2b-256 2c8c6a403df2876dfa6d8370d8232ccf2f8c35a19580dabfa56cabb3114a058f

See more details on using hashes here.

File details

Details for the file pydomainextractor-0.14.0-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pydomainextractor-0.14.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 bcee0ccd80658fe3d40d8cbb18df3af330ac7f751559dc2f8b0f40990c3eee78
MD5 f9af9870012b19f8c4c314eafd3fec54
BLAKE2b-256 c20a234a638057ab15d4f4eaf84e2dd112375fd8fa063ae76ce1514ecf2c9d54

See more details on using hashes here.

Release history Release notifications | RSS feed

0.14.2

12 files

This release

0.14.0 This release

16 files

0.13.9

20 files

0.13.5

20 files

0.13.4

20 files

0.13.3

20 files

0.13.2

17 files

0.13.0

17 files

0.12.0

15 files

0.11.1

13 files

0.11.0

13 files

0.10.0

1 file

0.9.4

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.9.0

1 file

0.8.5

1 file

0.8.4

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.0

1 file

0.6.1

1 file

0.6.0

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page