Skip to main content

Parse domain name properties.

Project description

Domainprops

Parse domain name properties

test codecov Code style: black

Install

python -m pip install domainprops

Usage

from domainprops import domainprops

domainprops.tld("foo.com")          # "com"
domainprops.sld("foo.com")          # "foo"
domainprops.is_alpha("foo.com")     # True
domainprops.is_numeric("foo.com")   # False

API

Function Description Example Result
tld (string) Top level domain tld("foo.com") "com"
sld (string) Sub level domain sld("foo.bar.com") "foo.bar"
bld (string) Bottom level domain bld("foo.bar.com") "foo"
length (int) Lenght of domain length("foo.com") 3
idn (string) IDN version of domain idn("f⊕⊕.com") "xn--f-vioa.com"
domains (list) Domain parts of domain domains("foo.bar.com") ["foo", "bar", "com"]
has_alpha bool Has alpha characters has_alpha("foo.com") True
has_numbers bool Has numbers has_numbers("foo.com") False
has_alphanum bool Has alpha characters and numbers has_alphanum("foo.com") False
has_hyphens bool Has hyphens has_hyphens("foo.com") False
is_alpha bool Is strictly alpha characters is_alpha("foo.com") True
is_numeric bool Is strictly numbers is_numeric("foo.com") False
is_alphanumeric bool Is strictly alpha characters and numbers is_alphanumeric("foo.com") False
is_subdomain bool Is a sub domain is_subdomain("foo.com") False

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

domainprops-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

domainprops-0.1.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file domainprops-0.1.1.tar.gz.

File metadata

  • Download URL: domainprops-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.0 Linux/4.15.0-99-generic

File hashes

Hashes for domainprops-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dfb099dd3b49807e0710b849167d5cb25bd5af146decd34c68cf26fef24c1525
MD5 2b09ca731bdd0de11991e2d15ba2fc6e
BLAKE2b-256 ef6dd606df8984f300031e420cc9d91bfbcdf4a374889bc16961923cfaa84fc1

See more details on using hashes here.

Provenance

File details

Details for the file domainprops-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: domainprops-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.0 Linux/4.15.0-99-generic

File hashes

Hashes for domainprops-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 265d111424a91d96271bb5879b9da08922ff07138e79875f534ddcf391ef79b0
MD5 3ea194403a605ab8e94f80cbb0f3512a
BLAKE2b-256 30490ae5863011725c620ee1681463cd1900a9a6fe21d74c9466561d06f847a0

See more details on using hashes here.

Provenance

Supported by

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