Metadata-Version: 2.1
Name: async-url-validator
Version: 1.0
Summary: Async package and CLI command for URL validation.
Home-page: http://github.com/cfytrok/async-url-validator
Author: Aleksandr Gavrilov
Author-email: sanya-991@mail.ru
License: MIT
Platform: any
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown
License-File: LICENSE

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

```python
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"```

