Async package and CLI command for URL validation.
Project description
Async package and CLI command for URL validation.
Allows you to check:
- server response code
- redirect settings
- presence of text on the page
It is possible to use throttling to avoid blocking.
Install
pip install py_url_validator
Usage
import asyncio
from async_url_validator import StatusAssigner, DomainThrottler, URLValidator
async def main():
status_assigner = StatusAssigner(page_text='not available')
request_method = (status_assigner.page_text and 'GET') or 'HEAD'
validator = URLValidator(request_method=request_method,
throttler=DomainThrottler(rate_limit_per_sec=10),
status_assigner=status_assigner)
urls = ['https://www.python.org', 'http://google.com']
async for status in validator.validate(*urls):
print(status)
asyncio.run(main())
CLI
url_validator -i input.csv -o output.csv -s "not available"
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
File details
Details for the file async-url-validator-1.0.tar.gz
.
File metadata
- Download URL: async-url-validator-1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75a8c29d097d477a83873ca23f91067959b5cc02f6a0e30a89b39320879e9a2a |
|
MD5 | 77f7a9ad78ca669b01d9df60f17eac84 |
|
BLAKE2b-256 | 5a9bd400fd43cdc4d28f029b5633b02ef17a46bcd4230b9ab925c42c9d085de1 |