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" |
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 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.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for domainprops-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b67bf99da0e47a015830602f4b42aebe1720113e4126882255013856689d26 |
|
MD5 | 05a20b58d07e31fe7084be8d480b4675 |
|
BLAKE2b-256 | 185fc385301b1a01bb3e5b756e9f1ac16cada0058d3019695ea24d4505e01611 |