skillfed

python-whois

Whois querying and parsing of domain registration information.

python-whois v0.9.6 2.0M downloads/30d#3,360 on PyPI456
Permissive license MIT Active released

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-whois

uv

uv add python-whois

poetry

poetry add python-whois

Installing 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

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTP

Tags

whois domain lookupparse whois datadomain registration infowhois server queryextract domain expirationwhois parser pythondomain registrar lookup
domain-lookupnetwork-tools

More WWW/HTTP packages