Skip to main content

CLI + Python API for batch compressing PDFs with iLovePDF.com

Project description

Svelte Masonry

Tests pre-commit.ci status PyPI This project supports Python 3.8+

The code in ilovepdf.py was inspired by Andrea Bruschi's pylovepdf.

Command line PDF compression powered by the free iLovePDF API.

Installation

pip install pdf-compressor

Usage

Tell pdf-compressor your iLovePDF API key (if you haven't yet, get one by signing up at https://developer.ilovepdf.com/signup):

pdf-compressor --set-api-key project_public_7c854a9db0...

Then start compressing!

pdf-compressor **/*.pdf

Options

pdf-compressor has the following flags:

  • -i/--inplace (optional, default: False): Whether to compress PDFs in place.
  • -s/--suffix (optional, default: -compressed): String to append to the filename of compressed PDFs. Mutually exclusive with --inplace flag.
  • --set-api-key (optional): Set the public key needed to authenticate with the iLovePDF API.
  • --debug (optional, default: False): When true, iLovePDF won't process the request but only reports the parameters that would have been sent to the server.
  • -v/--version (optional): Get the current version.

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

pdf-compressor-0.1.0.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

pdf_compressor-0.1.0-py2.py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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