Skip to main content

A CLI tool to check URLs and save webpages as PDFs

Project description

Webpage2PDF

A CLI tool to check URLs and save webpages as PDFs.

Installation

pip install -e .

Installation from PyPI

pip install webpage-to-pdf-converter

Usage

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

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.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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webpage_to_pdf_converter-1.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webpage_to_pdf_converter-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file webpage_to_pdf_converter-1.0.0.tar.gz.

File metadata

File hashes

Hashes for webpage_to_pdf_converter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8035f8c3379d4a1fc61c98df8f976a1bbe2d944186080933d649f83660b3533e
MD5 8aa869da6391b55fb4bc1f9f3e343b0f
BLAKE2b-256 01ef50609e12ec04e235510d938db9f5caa55f60d61d9c323122190af3ae9c46

See more details on using hashes here.

File details

Details for the file webpage_to_pdf_converter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for webpage_to_pdf_converter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2257fc5666461fbf1c53198026282c9b29298bba60c483fe74d14a176ecc2e6
MD5 75db62389bfde1c7ff72da15c82e2033
BLAKE2b-256 026ef63e6a95d04d7b06d758f2fe44a9dffee4964dc02d214676d66721dea77f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page