A super simple Python utility to check for dead links in a website
Project description
PyLich
A super simple Python utility to check for dead links in a website.
Installation
PyLich is available on PyPI and can be installed using pip:
pip install pylich
Usage
Simply provide the URL of the sitemap and pylich
will crawl through links in the pages and check their status. pylich
can be used as a command line tool or as a Python package.
Command Line
pylich https://www.example.com/sitemap.xml -v
The -v
verbosity flag is optional and will print progress to the console as well as a summary of the dead links at the end. The command will exit with a status code of 1 if any dead links are found and 0 otherwise.
Python Package
from pylich import LinkChecker
checker = LinkChecker("https://www.example.com/sitemap.xml", verbose=True)
urls = checker.get_sitemap_urls()
broken_links = checker.check_links(urls)
checker.print_dead_links()
Contributing
Pull requests are welcome.
Package and dependency management is done using Poetry. To install the dependencies and the package in development mode, run:
poetry install
To run the tests, run:
pytest
Pre-commit hooks are available to run code formatting and linting. To install the hooks, run:
pre-commit install
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
Built Distribution
File details
Details for the file pylich-0.2.0.tar.gz
.
File metadata
- Download URL: pylich-0.2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67706f17185b06ff15de54b0fea5c712634c85719bc9b2b6377e9814b8631145 |
|
MD5 | e53026c524a34b992774d77422162bb1 |
|
BLAKE2b-256 | 5b41c8cf85d3352ba90fd192be8707071a8ea7e8b5e39136be1e73988bb899af |
File details
Details for the file pylich-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pylich-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d28fd7c3a22830ab903b3831dec730df1c6fa92ab9cbf8b3ce210005055256 |
|
MD5 | 480aeb163352e9751273614093001862 |
|
BLAKE2b-256 | b23441dcab2af3dd07b6b693f9d0acf96a7d3c90c89f6e0bfdb3d1eb48857045 |