Python package for retrieving WHOIS information of domains.
Project description
whoisdomain
A Python package for retrieving WHOIS information of domains.
This package will not support querying ip CIDR ranges or AS information
A copy of the original DanyCork 'whois', I will start versioning at 1.x.x where the second item will be YYYYMMDD, the third will start from 1 and be only used if more than one update will have to be done in one day.
Features
- Python wrapper for the "whois" cli command of your operating system.
- Simple interface to access parsed WHOIS data for a given domain.
- Able to extract data for all the popular TLDs (com, org, net, biz, info, pl, jp, uk, nz, ...).
- Query a WHOIS server directly instead of going through an intermediate web service like many others do.
- Works with Python >= 3.6
- All dates as datetime objects.
- Possibility to cache results.
- Verbose output on stderr during debugging to see how the internal functions are doing their work
- raise a exception on Quota ecceeded type responses
- raise a exception on PrivateRegistry tld's where we know the tld and know we don't know anything
- allow for optional cleaning the response before extracting information
- optionally allow IDN's to be translated to Punycode
Dependencies
- please install also the command line "whois" of your distribution
- this library parses the output of the "whois" cli command of your operating system
Usage example
Install the cli whois
of your operating system if it is not present already,
e.g 'apt install whois' or 'yum install whois'
sudo yum install whois
$pip install whoisdomain
python
>>> import whoisdomain as whois
>>> d = whois.query('google.com')
>>> print(d.__dict__)
{'name': 'google.com', 'tld': 'com', 'registrar': 'MarkMonitor, Inc.', 'registrant_country': 'US', 'creation_date': datetime.datetime(1997, 9, 15, 9, 0), 'expiration_date': None, 'last_updated': datetime.datetime(2019, 9, 9, 17, 39, 4), 'status': 'clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)', 'statuses': ['clientDeleteProhibited (https://www.icann.org/epp#clientDeleteProhibited)', 'clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)', 'clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)', 'serverDeleteProhibited (https://www.icann.org/epp#serverDeleteProhibited)', 'serverTransferProhibited (https://www.icann.org/epp#serverTransferProhibited)', 'serverUpdateProhibited (https://www.icann.org/epp#serverUpdateProhibited)'], 'dnssec': False, 'name_servers': ['ns1.google.com', 'ns2.google.com', 'ns3.google.com', 'ns4.google.com'], 'registrant': 'Google LLC', 'emails': ['abusecomplaints@markmonitor.com', 'whoisrequest@markmonitor.com']}
>>> print(d.name)
google.com
>>> print (d.expiration_date)
None
>>> print (d.creation_date)
1997-09-15 09:00:00
ccTLD & TLD support
see the file: ./whoisdomain/tld_regexpr.py or call whoisdomain.validTlds()
Support
- Python 3.x is supported for x >= 6
- Python 2.x IS NOT supported.
Author's
- this is a rename copy of original work done in: https://github.com/DannyCork/python-whois
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file whoisdomain-1.20230416.5.tar.gz
.
File metadata
- Download URL: whoisdomain-1.20230416.5.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c41b71db64be0d9c01f50468af5020942ad76ff251d65889243f6e19e4c6aa |
|
MD5 | 42677ca46b2e59b2bf415218ab2876f1 |
|
BLAKE2b-256 | 3ba96225ccf74596163467350eaa2672ccac6922bdc27afc3926db358c758c29 |
File details
Details for the file whoisdomain-1.20230416.5-py3-none-any.whl
.
File metadata
- Download URL: whoisdomain-1.20230416.5-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a793a32551f2326f670f40a1520b0b2295c0da4547e1a50152ccf05ced45467c |
|
MD5 | 894e0ee350f77f58f678829032b8afb5 |
|
BLAKE2b-256 | f080b61d5b9829e58c80ce543c0a1da9027a255cb564796366c75deb6dd4df41 |