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.0.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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file py_whoare-0.1.0.tar.gz.

File metadata

  • Download URL: py_whoare-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b4e52685850cc68fc6a561c045431ba324d5ae60456d9739c0a707b6bbc1d02a
MD5 1a389dd9de51c781d7e1d25ab5f8e8d7
BLAKE2b-256 5a152cd9f40d7dcda4e51bb520a15ae0d8542d73e073c04ead3e9c186b888027

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_whoare-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 484fe51c2855164045cb9c8b5127b00130b351c68af4bd335476321d07fd706c
MD5 7bd1d3164717a2cc97de17ce687c8819
BLAKE2b-256 1b8153ac2b2a31a8a46ecbcf5080ca68506ee27b6a9311a714abe6e56afc4cb0

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