No project description provided
Project description
PDF Link Checker
This is a fork of the pdf-link-checker.
Situation: You need to upload a PDF somewhere
Now, you want to check if all the links are still active and that the reviewers, reader, or students end up with 404
error codes.
Let this script check that for you!
Setup
-
Install Python
-
Install the
python-pdf-link-checker
via the Python Package Registry.pip install python-pdf-link-checker
Attention: On macOS,
pip
is usually the installer of the Python2 instance. Please usepip3
orpip3.x
in this case. -
Now you should be able to call
pdf-link-checker
within your shell.$ pdf-link-checker --version pdf-link-checker 1.1.5
Usage
Check Links
$ pdf-link-checker check-links --help
Usage: pdf-link-checker check-links [OPTIONS] [PDF_FILE]
- Get input PDF and output CSV location. - execute
check_pdf_links(infilepath, infilepath) - Save the report to output CSV
location.
Arguments:
[PDF_FILE] The PDF file to check.
Options:
-r, --report FILE The CSV file with all the checked links.
[default: report.csv]
-I, --ignore-url TEXT URL that should not be checked, e.g., because we
now that they are not activated yet. [default: ]
-C, --ci If set, the command will exit with an error code
if there are broken URLs. [default: False]
-c, --csv-delimiter TEXT The CSV delimiter, e.g., `;` [default: ;]
-A, --ignore-unauthorized If this flag is set, we will ignore 403 status
codes. Some websites block scripts, and thus
existing links will result in 403 codes.
[default: False]
--help Show this message and exit.
Check Page Limit
$ pdf-link-checker check-page-limit --help
Usage: pdf-link-checker check-page-limit [OPTIONS] [PDF_FILE]
Check the page limit.
Arguments:
[PDF_FILE] The PDF file to check.
Options:
-l, --page-limit INTEGER The maximal number of pages
--help Show this message and exit.
Example
$ pdf-link-checker check-links main.pdf
Starting
100%|█████████| 5/5 [00:30<00:00, 6.18s/it]
Done: .../report.csv
Run Pytest to validate returns
From the script directory, run pytest
to validate the code. The tests use the PDFs in the data folder.
Contact
If you have any question, please contact Patrick Stöckle.
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 python_pdf_link_checker-1.1.10.tar.gz
.
File metadata
- Download URL: python_pdf_link_checker-1.1.10.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6491fd9016106f6870471042f9d45a72cad81a7621313c3443d45b746f3a869 |
|
MD5 | ee69a40a7f2ffa09879c3d59875f10c2 |
|
BLAKE2b-256 | 5b12600255af6e897dcba8da7a61169aa666bac0802667f3342bd79f3cb916a9 |
File details
Details for the file python_pdf_link_checker-1.1.10-py3-none-any.whl
.
File metadata
- Download URL: python_pdf_link_checker-1.1.10-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d619a4b15251638f281a9a8916172186e32bec9ba84e6ec8e3fcdb55d9a64b2 |
|
MD5 | 8aa0cb4b09e58dae3a8cb3db29aacba9 |
|
BLAKE2b-256 | ef14aef90ed3791e978ef827eb745af245677c0d81a081a17e825bdf57039bd2 |