Skip to main content

whois-parser

PyPI version Python CI Coverage Status

Yet another whois parser for Python. 🐍

  • Parse a whois record by using PyParsing not Regex.
  • Return a parsed record as dataclass not dict.

Installation

pip install whois-parser

Usage

import sh
from whois_parser import WhoisParser

# get whois record
hostname = "google.co.jp"
whois = sh.Command("whois")
raw_text = whois(hostname)

# parse whois record
parser = WhoisParser()
record = parser.parse(raw_text, hostname=hostname)
print(record)
# => WhoisRecord(raw_text="...", registrant=Registrant(organization='グーグル合同会社', email=None, name=None, telephone=None), admin=Admin(organization=None, email=None, name=None, telephone=None), tech=Tech(organization=None, email=None, name=None, telephone=None), abuse=Abuse(email=None, telephone=None), statuses=['Connected (2022/03/31)'], name_servers=['ns1.google.com', 'ns2.google.com', 'ns3.google.com', 'ns4.google.com'], domain='google.co.jp', registrar=None, expires_at=None, registered_at=datetime.datetime(2001, 3, 22, 0, 0), updated_at=datetime.datetime(2021, 4, 1, 1, 5, 22, tzinfo=<StaticTzInfo 'JST'>))

Customize / Contribution

Whois's responses will follow a semi-free text format. Thus, unfortunately, this library does not support all the formats in the wild.

You can create customized parsers to suit your needs. References are placed in whois-parser/parsers/.

Any contribution is welcome.

Metadata

Release files for whois-parser 0.3.1

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

Source distribution (sdist)

Source distribution for whois-parser 0.3.1
File Size Uploaded
whois_parser-0.3.1.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whois-parser 0.3.1
File Interpreter ABI Platform
whois_parser-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / whois_parser-0.3.1.tar.gz

Download URL whois_parser-0.3.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
961c1ae9cff77981405c35be514934e69230cd6d9a8a59cf1aecce25acb924a0
BLAKE2b-256 checksum
How to use checksums
e364b33c9b252359101ed14cfdced7c5548d2f35721140854062d357050abe6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release files / whois_parser-0.3.1-py3-none-any.whl

Download URL whois_parser-0.3.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f360e5d460f5490d9dce15dad0d6ce705a3a5cdc2adc653e3e74b37034ba4fa
BLAKE2b-256 checksum
How to use checksums
1b15759b2978d9576199f5c2ba3eeb354780b9a76ccba0d808730c5dbe7d0551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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