Skip to main content

Simple package to interact with the whois command line tool

Project description

Avaiability

Platform Status
MacOS Supported ✅
Linux In Progress 🚧
Windows Not supported yet ❌

Installation

To install the package, just run the following command:

pip install whotfis-py

Usage

import whotfis_py
result = whotfis_py.lookup("QUERY", registry)

The package has different classes for different registers on which will the whois lookup be performed, so when executing the query is possible to specify the database MACRO

import whotfis_py
from whotfis_py import registries

whotfis_py.lookup("QUERY", registries.RADB)

From the available registers the program supports:

  • ARPIN
  • APNIC
  • ABUSE
  • AFRINIC
  • USMILITARY
  • INTERNIC
  • IANA
  • KRNIC
  • LACNIC
  • RIPE
  • RADB

If you want to specify a custom register you also need to provide the server name for that register

whotfis_py.lookup("QUERY", registries.CUSTOM, "whois.radb.net")

Results

The lookup() function will return a class depending on the registry you passed, all the classes are specified in the file whois_py/result.py, if you want to list all the possible values at runtime you can use the dir()method on the object

result = whotfis_py.lookup("QUERY", registries.RADB)
attributes = dir(result)

All the classes inherit from the whois_result super class, which provide the dict() method to convert all the instances of the class to dictionary

result = whotfis_py.lookup("QUERY", registries.RADB)
print(result.dict())

Since the CUSTOM registry output is unknown the parameters will be setted at runtime during the lookup, the accepted parameters are only in the key:value shape.

In case of duplicate keys in the output there are two policies, a list of appendable keys is provided for each class in the whois_result class, if the key is not in the list the value will be overwritten, otherwise the value will be appended to the others.

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

whotfis_py-0.0.7.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whotfis_py-0.0.7-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file whotfis_py-0.0.7.tar.gz.

File metadata

  • Download URL: whotfis_py-0.0.7.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for whotfis_py-0.0.7.tar.gz
Algorithm Hash digest
SHA256 dd300eec64012761fb2dbdda0545127ae35926c525c7fa56a398aa096d740421
MD5 d0ccb2ee324c048c1a04d706df72cd54
BLAKE2b-256 edda52841290cbf65849997d1784fcf2ed2d854b2e74f18fa44c69025a00c0a6

See more details on using hashes here.

File details

Details for the file whotfis_py-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: whotfis_py-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for whotfis_py-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 59b24e12a60cae3578656ec8af0b57b3ea6d6e3f234b517c4cd188a8c0b22c93
MD5 a78bc460805c0b6d5d90bdf55248639f
BLAKE2b-256 3a337bfbf06845db6f4997ef7170e1ce19859b864de43262480c7af0ca20e744

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page