Parse domain name properties.
Project description
Domainprops
Parse domain name properties
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 | Returns | 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" |
pattern |
string |
Char pattern | pattern("foo-123.com") |
"lll-nnn" |
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/or numbers | is_alphanumeric("foo.com") |
True |
is_subdomain |
bool |
Is 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.2.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for domainprops-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 253c72f0214763411f7ec5f4c8db3a76d4c24a42894ed2a36ba35603b0de482d |
|
MD5 | e616ddcfa1dc9ca220b34b06cc0acd19 |
|
BLAKE2b-256 | 315ebdc0a78ad6933eaeecfa780a0e6389b29d86ec2318a0eff504e99330c7ed |