Async-compatible Python module for retrieving WHOIS information for domains.
Project description
Async-compatible Python module for retrieving WHOIS information of domains. Based on richardpenman/pywhois
Installation
pip install asyncwhois
Examples
asyncio
import asyncio
import time
import asyncwhois
async def main():
urls = [
'https://www.google.co.uk',
'en.wikipedia.org/wiki/Pi',
'https://www.urbandictionary.com/define.php?term=async',
'twitch.tv',
'reuters.com',
'https://www.pcpartpicker.com',
'https://packaging.python.org/',
'imgur.com'
]
tasks = []
for url in urls:
awaitable = asyncwhois.lookup(url)
tasks.append(awaitable)
await asyncio.gather(*tasks)
if __name__ == '__main__':
start = time.time()
asyncio.run(main())
print(f'Done! [{round(time.time() - start, 4)}] seconds.')
aiohttp
from aiohttp import web
import asyncwhois
async def whois(request):
domain = request.match_info.get('domain', 'google.com')
result = await asyncwhois.lookup(domain)
return web.Response(text=f'WhoIs parsed:\n{result}')
app = web.Application()
app.add_routes([web.get('/whois/{domain}', whois)])
web.run_app(app)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncwhois-0.1.2.tar.gz
(88.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asyncwhois-0.1.2.tar.gz.
File metadata
- Download URL: asyncwhois-0.1.2.tar.gz
- Upload date:
- Size: 88.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e1445cb6f0e4391842876f899c0f09979bcaa47f11c7dec9751d2a7e68d704d
|
|
| MD5 |
6f6661857332d82d2e9e98ac288a247b
|
|
| BLAKE2b-256 |
c84b48b6f62440dd6f9265277e9c9ace5a0910d1695b534d2f8bfbf1366842f0
|
File details
Details for the file asyncwhois-0.1.2-py3-none-any.whl.
File metadata
- Download URL: asyncwhois-0.1.2-py3-none-any.whl
- Upload date:
- Size: 90.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb9ead6af901ba1bbff81738a3719bfda9b68ee65f48d404bc182e7e0039f9c2
|
|
| MD5 |
d42524b64658930ed7a0b69e1f9de344
|
|
| BLAKE2b-256 |
5e56dacf547bceb64faa067d3a03357c535f9d1b39e4bb75c10f6aea8acf8b40
|