Skip to main content

Simple package to interact with the whois command line tool

Project description

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.6.tar.gz (8.6 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.6-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whotfis_py-0.0.6.tar.gz
  • Upload date:
  • Size: 8.6 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.6.tar.gz
Algorithm Hash digest
SHA256 d6e74e75a67456e1d2946e8c2557dd1920a5024326d1a6c8821d1363fa26be8f
MD5 2702c712f5b224bf878c3e2adc0074b0
BLAKE2b-256 28362edd57013f5b75fb80bd86529ae108598cabd910f1f5b395a1995cb08613

See more details on using hashes here.

File details

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

File metadata

  • Download URL: whotfis_py-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 19e6426a63fa5ea545b31399bb69d6903b1e595626742371ab027fc6d2b70b5c
MD5 e03784d2f233c27de4861aa1ed088a1d
BLAKE2b-256 5f443c6ee8823b3b9c6304b3f0c1abb7a6e8bf87e6e2bcb7637cee3314b34bc6

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