PDF Link Checker
Github Action and CLI tool to automatically check all links in a PDF for availability to find dead or broken links.
Usage
Install the package using pip
pip install pdflinkchecker_cli
and use it as a CLI tool
pdflinkchecker . # to search for and check all pdfs in the current directory recursively
pdflinkchecker path/to/pdf # to check a specific file
pdflinkchecker path/to/pdf1 path/to/pdf2 # to check multiple specific files
Exemplary output looks like this
Analyzed /data/dummy1.pdf, found the following types of links/http codes: {200: 13}
Analyzed /data/dummy2.pdf, found the following types of links/http codes: {'mail': 4, 'tel': 4, 200: 49, 'error': 3}
| Page Number | URL | Details |
|---------------+--------------------------+---------------------------------------------------------------------|
| 1 | https://www.example1.com | <HTTPError 999: 'INKApi Error'> |
| 1 | https://www.example2.com | URLError(timeout('_ssl.c:1112: The handshake operation timed out')) |
| 1 | https://www.example3.com | <HTTPError 403: 'Forbidden'> |
To use the Github Action, create a pdf_link_checker.yml in .github/workflows:
on: [ push ]
jobs:
check_pdf_links:
runs-on: ubuntu-latest
name: Check PDF Links
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PDF Link Checker
uses: a-nau/pdf-link-checker@v0.2.0
with:
paths: '.' # checks all PDFs, otherwise specify to file path(s)
To run within Docker
docker build -t pdf_link_checker .
docker run -it --rm --mount type=bind,source=${PWD},target=/data/ --name pdf_link_checker pdf_link_checker /data/.
Credits
I started from pdf-link-checker
by Matt Briggs. Especially get_links_from_page is still heavily borrowed from the
original.
This work is licensed under the MIT license.
Metadata
Release files for pdflinkchecker-cli 0.2.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 | Actions |
|---|---|---|---|---|
| pdflinkchecker_cli-0.2.0.tar.gz | 5.1 kB | Without provenance | Details for pdflinkchecker_cli-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdflinkchecker_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pdflinkchecker_cli-0.2.0-py3-none-any.whl |
Total release size: 10.8 kB
Release files / pdflinkchecker_cli-0.2.0.tar.gz
| Download URL | pdflinkchecker_cli-0.2.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62954960efe6778b84a777bbc1f26d2f130d0f22bf8da9ec0f57831b39a6a9a4
|
|
BLAKE2b-256 checksum How to use checksums |
bb42886fd20954d20f665b45219eb43130ef5504d8c857a40171f47ebee56554
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / pdflinkchecker_cli-0.2.0-py3-none-any.whl
| Download URL | pdflinkchecker_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6042d3adf2992bd7a76cc5a5bb0ccb763e05f2dc5f9ae8345821a26f66e0e1bc
|
|
BLAKE2b-256 checksum How to use checksums |
2ac4f3347b9afe28c9ca79b692f5608d92ecbc4b09658d5b2761c2ac7dd565d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for pdflinkchecker-cli 0.2.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.