Skip to main content

whois21

version stars forks repo size CodeFactor

whois21 is a simple and easy to use python package that lets you easily query whois information of a domain.

Features

WHOIS

issues contributors

Installation

Well, this is a python package so the first thing you need is python.

If you don't have python installed, please visit Python.org and install the latest version of python based on your OS.

Then you can install whois21 using pip module:

# Use this command to get the latest version from pypi.org and install it automatically
python -m pip install whois21 -U

# OR
# Download the release file from GitHub: https://github.com/MPCodeWriter21/whois21/releases
# And install it using this command
pip install whois21-x.x.x.tar.gz

Or you can clone the repository and run:

python setup.py install

Changes

1.0.0

Version 1.0.0

Usage Examples:

CLI Examples

  • Example 1: Query whois information of google.com
# -v : verbose mode
whois21 -v results google.com
  • Example 2: Query whois information of 3 domains and save the results to a directory
# -R : saves the results as raw text
# -np: avoids printing the results to the screen
# -o results: saves the results to `./results` directory 
whois21 -R -np -o results google.com facebook.com pinterest.com
  • Example 3: Query whois information of 3 IPs and save the results to a directory
# Options explained in the examples above
whois21 -R -np -v -o results 1.1.1.1 157.240.20.174 64.91.226.82
  • Example 4: Query RDAP information of domains and IPs and save the results to a file
# -r: Gets the RDAP information of the queried domains and IPs
whois21 -np -o results -o results -r microsoft.com python.org 140.82.121.3 185.147.178.13

Python Code Examples

  • Example 1: Query whois information of GitHub.com using WHOIS class.
# First step is to import the package
import whois21

query = 'github.com'

# Second step is to create an instance of the WHOIS class
whois = whois21.WHOIS(query)

# Third step is to check if the operation was successful
if not whois.success:
    print(whois.error)
    exit()

# And basically you are done!
# Now you can print the results
import log21  # I use log21 to print the results in a cool way 8D

# Print the results in a nice way
# PPrint the dictionary
log21.pprint(whois.whois_data)
# Tree-Print the dictionary
log21.tree_print(whois.whois_data)

# Or you can print the results in as raw text
print(whois.raw.decode('utf-8'))

# Or you can access each part of the results individually
print(f'Creation date   : {whois.creation_date}')
print(f'Expiration date : {whois.expires_date}')
print(f'Updated date    : {whois.updated_date}')

About

Author: CodeWriter21 (Mehrad Pooryoussof)

GitHub: MPCodeWriter21

Telegram Channel: @CodeWriter21

Aparat Channel: CodeWriter21

License

License

apache-2.0

Donate

In order to support this project you can donate some crypto of your choice 8D

Donate Addresses

Or if you can't, give this project a star on GitHub :)

Release files for whois21 1.0.0

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

Source distribution (sdist)

Source distribution for whois21 1.0.0
File Size Uploaded
whois21-1.0.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whois21 1.0.0
File Interpreter ABI Platform
whois21-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / whois21-1.0.0.tar.gz

Download URL whois21-1.0.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a23cf70deb3c8aae9431a65faac170a121d19af35a20f49b2727a1dd05840eb
BLAKE2b-256 checksum
How to use checksums
ce74f6731328b2d34f561adef455496f1379e3d4fd4eae3af9da86160b13cc40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / whois21-1.0.0-py3-none-any.whl

Download URL whois21-1.0.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd2ef1f6f1455f0a9e141f9288fcd51af1fb1f57415172a4f655bad03e7f0f71
BLAKE2b-256 checksum
How to use checksums
5869c73fa41a141d1ff51c5df695001a1a71eb7b371faedf9bb779cd5997a702
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

This release

1.0.0 This release

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