Giter VIP home page Giter VIP logo

domaintools's Introduction

domaintools

Domain parsing with python

Usage

Basic usage:

from domaintools import Domain
d = Domain('www.example.com')

Validate domain (also validates TLD):

>>> d.valid
True

Access domain parts:

>>> d.domain
u'example.com'

>>> d.subdomain
u'www'

>>> d.tld
u'com'

>>> d.sld
u'example'

IDN domain support

>>> d = Domain('xn--4gqx73hwke.com', decode_idna=True)
>>> d.domain
u'\u7edf\u4e00\u7801.com'

Installation

pip install 'git+git://github.com/devhub/domaintools.git'

Supported TLDs

aaa.pro
ac
ac.cn
ac.nz
aca.pro
acct.pro
act.au
ad
ae
ae.org
aero
af
ag
ah.cn
ai
al
am
an
ao
aq
ar
ar.com
as
asia
asn.au
at
au
avocat.pro
aw
ax
az
ba
bar.pro
bb
bd
be
bf
bg
bh
bi
biz
biz.pr
bj
bj.cn
bm
bn
bo
br
br.com
bs
bt
bv
bw
by
bz
ca
cat
cc
cd
cf
cg
ch
ci
ck
cl
club.tw
cm
cn
cn.com
co
co.ae
co.in
co.jp
co.nz
co.uk
co.za
com
com.af
com.au
com.cn
com.ec
com.es
com.mx
com.ph
com.pr
com.pt
com.sg
com.tw
coop
cpa.pro
cq.cn
cr
cu
cv
cx
cy
cz
de
de.com
dj
dk
dm
do
dz
ebiz.tw
ec
edu
edu.au
ee
eg
er
es
est.pr
et
eu
eu.com
fi
fin.ec
firm.in
fj
fj.cn
fk
fm
fo
fr
ga
game.tw
gb
gb.com
gb.net
gd
gd.cn
ge
geek.nz
gen.in
gen.nz
gf
gg
gh
gi
gl
gm
gn
gov
gp
gq
gr
gr.jp
gs
gs.cn
gt
gu
gw
gx.cn
gy
gz.cn
ha.cn
hb.cn
he.cn
hi.cn
hk
hl.cn
hm
hn
hn.cn
hr
ht
hu
hu.com
i.ph
id
id.au
idv.tw
ie
il
im
in
ind.in
info
info.ec
info.pr
int
io
iq
ir
is
isla.pr
it
je
jl.cn
jm
jo
jobs
jp
jpn.com
js.cn
jur.pro
jx.cn
ke
kg
kh
ki
kids.us
km
kn
kp
kr
kr.com
kw
ky
kz
la
law.pro
lb
lc
li
lk
ln.cn
lr
ls
lt
ltd.uk
lu
lv
ly
ma
maori.nz
mc
md
me
me.uk
med.ec
med.pro
mg
mh
mil
mk
ml
mm
mn
mo
mobi
mp
mq
mr
ms
mt
mu
museum
mv
mw
mx
my
mz
na
name
name.ae
name.pr
nc
ne
ne.jp
net
net.ae
net.af
net.au
net.cn
net.ec
net.in
net.mx
net.nz
net.ph
net.pr
net.pt
net.sg
net.tw
net.uk
nf
ng
ngo.ph
ni
nl
nm.cn
no
no.com
nom.es
nom.za
nome.pt
np
nr
nsw.au
nt.au
nu
nx.cn
nz
om
or.jp
org
org.ae
org.af
org.au
org.cn
org.ec
org.es
org.in
org.mx
org.nz
org.ph
org.pr
org.pt
org.sg
org.tw
org.uk
org.za
pa
pe
per.sg
pf
pg
ph
pk
pl
plc.uk
pm
pn
pr
pro
pro.ae
pro.ec
pro.pr
ps
pt
publ.pt
pw
py
qa
qc.com
qh.cn
qld.au
re
recht.pro
ro
rs
ru
ru.com
rw
sa
sa.au
sa.com
sb
sc
sc.cn
school.nz
sd
sd.cn
se
se.com
se.net
sg
sh
sh.cn
si
sj
sk
sl
sm
sn
sn.cn
so
sr
st
su
sv
sx.cn
sy
sz
tas.au
tc
td
tel
tf
tg
th
tj
tj.cn
tk
tl
tm
tn
to
tp
tr
travel
tt
tv
tw
tw.cn
tz
ua
ug
uk
uk.com
uk.net
us
us.com
uy
uy.com
uz
va
vc
ve
vg
vi
vlc.au
vn
vu
wa.au
wf
ws
xj.cn
xxx
xz.cn
ye
yn.cn
yt
za
za.com
zj.cn
zm
zw

License

domaintools is released under the the MIT license.

Credits

Originally developed by Mark Lee while employed at EVO Media Group.

domaintools's People

Contributors

dlrust avatar dieselmachine avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.