python-whois
Whois querying and parsing of domain registration information.
What it is and what it does
python-whois connects directly to WHOIS servers to retrieve and parse domain registration information. Raw WHOIS responses are converted into structured Python objects with typed fields—dates become datetime objects, name servers become lists—making it easy to programmatically access registration details like expiration dates, registrar names, and creation timestamps. The package supports popular TLDs (com, org, net) and allows adding custom parsers for additional domain extensions; queries can be routed through a SOCKS proxy if needed.
The module is straightforward to use: import, call whois() with a domain name, and access parsed attributes or the raw text response. Maintained since 2013 with a single runtime dependency on python-dateutil, the installation footprint is minimal.
Use it for:
- Check domain expiration dates programmatically to monitor renewal deadlines.
- Extract registrar and name server information for domain audits or DNS troubleshooting.
- Bulk query domain registration metadata for security research or domain analysis.
- Validate domain ownership details as part of an automated verification workflow.
- Monitor changes to domain registration records by comparing parsed WHOIS snapshots.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Queries WHOIS servers directly to retrieve and parse domain registration data, converting dates to Python datetime objects and extracting structured fields like registrar, name servers, and expiration dates.
Yes. The package fills a clear need—direct WHOIS parsing without external web services—with low friction (one dependency), permissive MIT licensing, active maintenance, and no known vulnerabilities. Widely used (top 5000 on PyPI) and suitable for domain lookup automation, though reliability depends on WHOIS server availability and format consistency.
Install
python-whois on PyPI
pip
pip install python-whoisuv
uv add python-whoispoetry
poetry add python-whoisInstalling python-whois
Before you install
Low install friction with a single runtime dependency (python-dateutil). Actively maintained with recent commits; last commit 2026-07-12 with status marked active.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install python-whois
import whois
w = whois.whois('example.com')
print(w.expiration_date) # Returns datetime object
print(w.name_servers) # Returns list of name servers
Verify before relying
- Whether WHOIS server availability and response formats remain stable across all supported TLDs.
- Current test coverage and reliability for less common TLDs beyond the popular ones mentioned.
- Whether proxy support via SOCKS environment variable is fully functional in the current release.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — python-dateutil |
| Maintenance | actively maintained — 311 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,016,100/month — #3,360 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_whois-0.9.6-py3-none-any.whl
Keywords: whois, python
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
whoisRetrieves WHOIS information for domain names by…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
PyFunceble-devPyFunceble checks whether domains, IPs, and…
permissive · top 15,000 on PyPI
publicsuffix2Extracts the public suffix and registrable…
copyleft · top 5,000 on PyPI
tldparseParses domain names into their constituent…
permissive · top 15,000 on PyPI
tldextractAccurately extracts subdomain, domain, and…
permissive · top 1,000 on PyPI
publicsuffixlistParses the Public Suffix List to extract the…
copyleft · top 5,000 on PyPI
urlextractExtracts URLs from text by locating TLDs and…
permissive · top 5,000 on PyPI
tldExtracts the top-level domain (TLD) and…
copyleft · top 5,000 on PyPI
tldsProvides a set of valid top-level domains…
permissive · top 15,000 on PyPI