Yet another whois parser for Python
Project description
whois-parser
Yet another whois parser for Python. 🐍
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whois-parser-0.1.3.tar.gz
(8.4 kB
view hashes)
Built Distribution
Close
Hashes for whois_parser-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 597ec827d8a4e2e67029ddc7fd31d7000201ba666f09c3566fb94dd24963511d |
|
MD5 | d662e15f2e1d3c51544354488338fbb6 |
|
BLAKE2b-256 | 084e37d8d4425c0bd90597482bad93944f85662d43df931d21a48b849108eaaf |