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"
Metadata
Release files for async-url-validator 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| async-url-validator-1.0.tar.gz | 5.4 kB | Without provenance | Details |
Release files / async-url-validator-1.0.tar.gz
| Download URL | async-url-validator-1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75a8c29d097d477a83873ca23f91067959b5cc02f6a0e30a89b39320879e9a2a
|
|
BLAKE2b-256 checksum How to use checksums |
5a9bd400fd43cdc4d28f029b5633b02ef17a46bcd4230b9ab925c42c9d085de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Security for async-url-validator 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.