Skip to main content

A Python library for performing WHOIS queries on multiple domains.

Project description

py-whoare

py-whoare is a Python library designed for performing WHOIS queries on multiple domains simultaneously. It provides an easy-to-use interface for fetching domain registration details, including registrar information, registration dates, and more, along with IP geolocation data.

Features

  • WHOIS query execution for multiple domains.
  • IP address resolution for each domain.
  • Geolocation data retrieval for each IP address.
  • Asynchronous implementation for efficient handling of multiple requests.

Installation

Install py-whoare using pip:

pip install py-whoare

Usage

py-whoare can be used in different environments, supporting both native async environments (like Jupyter notebooks) and standard Python scripts. Here are two examples to illustrate its usage:

Example 1: Using asyncio.run (Recommended for Python 3.7+)

This is the simplest way to run asynchronous code. It's suitable for scripts and environments that don't have a running event loop.

import asyncio
from py-whoare import WhoAre

async def main():
    whoare_instance = WhoAre()
    results = await whoare_instance.handle_multiple_queries(["example.com", "example.org"])
    for result in results:
        # Process and print results as needed

# Run the async function
asyncio.run(main())

Example 2: Manual Event Loop Management

In environments where asyncio.run is not suitable (like in some interactive environments or when integrating with applications that manage their own event loop), you can manually create and manage an event loop.

import asyncio
from py-whoare import WhoAre

async def main():
    whoare_instance = WhoAre()
    return await whoare_instance.handle_multiple_queries(["example.com", "example.org"])

# Creating a new event loop and running the main coroutine
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
try:
    results = loop.run_until_complete(main())
    # Process and print results as needed
finally:
    loop.close()

Contributing

Contributions to py-whoare are welcome! Please refer to the Contributing Guidelines for more information.

License

py-whoare is available under the MIT License. See LICENSE for more details.

Contact

For any questions or feedback, please contact me at engjellavdiu01@gmail.com.

Acknowledgements

Thanks to all the contributors and users of py-whoare. Your support and feedback are greatly appreciated!

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

py-whoare-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

py_whoare-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file py-whoare-0.1.1.tar.gz.

File metadata

  • Download URL: py-whoare-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for py-whoare-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c12fe953a4d03897b072526abea6f0735881f3808470159ed5970ffbff9da43e
MD5 e71a959a4183989698d5fff8054d9092
BLAKE2b-256 6595c4cdb4c28881498b81340689aac9d4ad929dcf90181503193498a10e20c2

See more details on using hashes here.

File details

Details for the file py_whoare-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: py_whoare-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for py_whoare-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16df5be82676926d7f0b88469f22f4b6341c871ad161d61e6a9dc0d4f14a8376
MD5 5c76d110cb7d3fc9eee506135dfc816b
BLAKE2b-256 d811c7b62ca185e7d0c7717437b5cf2aa06333852d563eae156a037aaf8df100

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