Skip to main content

Webpage2PDF

A CLI tool to check URLs and save webpages as PDFs with advanced error handling and retry mechanisms.

Installation

pip install -e .

Installation from PyPI

pip install webpage-to-pdf-converter

Features

  • URL reachability checking with retry mechanism
  • PDF generation from webpage screenshots
  • Progress indicators and detailed logging
  • Docker support with volume mounting
  • Error handling with detailed messages
  • Configurable timeouts and retries

Usage

Basic URL checking:

webpage-to-pdf https://example.com

Save as PDF with custom settings:

webpage-to-pdf https://example.com --save-pdf --output output.pdf --timeout 60

Docker

Build the Docker image:

docker build -t url-checker .

Running with Docker

  1. Create a local output directory:
mkdir -p output
  1. Run the container with volume mount:
docker run --rm -v $(pwd)/output:/app/output url-checker https://example.com --save-pdf --output /app/output/webpage.pdf

The PDF file will be saved in your local output directory. The tool will show both the container path and the absolute path of the generated file:

✓ PDF saved successfully as '/app/output/webpage.pdf'
File location: /app/output/webpage.pdf

Using the Program with Docker

After building the image, you can run the container to check a URL directly. For example, to check "https://example.com" and save the webpage as a PDF, run:

docker run --rm url-checker https://example.com --save-pdf

Release History

  • 1.1.0 (2024-02-05)

    • Added retry mechanism with exponential backoff
    • Improved error handling and logging
    • Added progress indicators
    • Better Docker volume support
    • Chrome compatibility fixes
  • 1.0.0 (2024-03-XX)

    • Initial release
    • URL reachability checking
    • PDF generation from webpages
    • Docker support
    • Chrome/Chromium support

CI/CD

This project utilizes GitHub Actions for continuous integration. Refer to ci.yml for workflow details.

Development

Install development dependencies:

pip install -e ".[test]"

Run tests:

pytest

Metadata

Release files for webpage-to-pdf-converter 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webpage-to-pdf-converter 1.1.0
File Size Uploaded
webpage_to_pdf_converter-1.1.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webpage-to-pdf-converter 1.1.0
File Interpreter ABI Platform
webpage_to_pdf_converter-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / webpage_to_pdf_converter-1.1.0.tar.gz

Download URL webpage_to_pdf_converter-1.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7b442aafddcc30ec805b970837144c20db2caf657373f4a0e314f7facc2388b0
BLAKE2b-256 checksum
How to use checksums
4e68ce646bcfbcd206d0f3b58a42c700b8e960888397f64edce0587f9aac9dc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / webpage_to_pdf_converter-1.1.0-py3-none-any.whl

Download URL webpage_to_pdf_converter-1.1.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ef61e59602eb2fe5fc1f44ce930a5235318ba7c9730f40231bd2503a7bf8332
BLAKE2b-256 checksum
How to use checksums
d497fa3f5d2dcf10fa1d643a8bd5b483f9c3fdfee2b728c308bcd01f55714d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page