Skip to main content

whois

A Python package for retrieving WHOIS information of domains.

Features

  • Python wrapper for Linux "whois" command.
  • 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.x.
  • 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 whois response before extracting information
  • International domain name support & common Chinese domain name support

Help Wanted

Fork from: https://github.com/DannyCork/python-whois/labels/help%20wanted 基于python-whois 项目增加了对常见中文域名的支持

Usage example

Install pypywhois package from your distribution (e.g apt install pypywhois)

$pip install pypywhois

>>> import pypywhois
>>> domain = pypywhois.query('google.com')

>>> print(domain.__dict__)
{
	'expiration_date': datetime.datetime(2020, 9, 14, 0, 0),
	'last_updated': datetime.datetime(2011, 7, 20, 0, 0),
	'registrar': 'MARKMONITOR INC.',
	'name': 'google.com',
	'creation_date': datetime.datetime(1997, 9, 15, 0, 0)
}

>>> print(domain.name)
google.com

>>> print(domain.expiration_date)
2020-09-14 00:00:00

>>> domain = pypywhois.get('meta.com')
>>> print(domain)

>>> domain = pypywhois.get('meta.中文网', internationalized=True)
>>> print(domain)

ccTLD & TLD support

see the file: ./whois/tld_regexpr.py or call whois.validTlds()

Issues

Raise an issue https://github.com/DannyCork/python-whois/issues/new

Changes:

2022-07-08: 新增支持的中文域名后缀

  • 手机
  • 信息
  • 中國
  • 新闻
  • 移动
  • 联通
  • 微博

2022-07-06: 新增支持的中文域名后缀

  • 中文网
  • 在线
  • 中国
  • 娱乐
  • 机构
  • 组织机构
  • 公司
  • 集团
  • 网站
  • 网络
  • 政府
  • 游戏
  • 企业
  • 政务

Support

Python 3.x is supported.

Python 2.x IS NOT supported.

Release files for pypywhois 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypywhois 1.2
File Size Uploaded
pypywhois-1.2.tar.gz 98.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypywhois 1.2
File Interpreter ABI Platform
pypywhois-1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 198.2 kB

Release files / pypywhois-1.2.tar.gz

Download URL pypywhois-1.2.tar.gz
Size 98.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9c117a514c2fa4c03e8e287502be43d4b3ece19563b7aa3ba879dfe96c311bea
BLAKE2b-256 checksum
How to use checksums
9173f1860cf43f052ef0af40099c323e6efbdcb10bb96a69ba0981601fe5128b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.5

Release files / pypywhois-1.2-py2.py3-none-any.whl

Download URL pypywhois-1.2-py2.py3-none-any.whl
Size 99.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
abaf93fcb414063f337574d89d3887a2b8f258f22eba2eec95e83806afe45221
BLAKE2b-256 checksum
How to use checksums
1b34eb176936f7976d9f4890d492fcc956e2aec93c9e599f2d86c6f150f0b844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page