Skip to main content

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

Project description

PDF Compressor

Tests pre-commit.ci status PyPI Requires Python 3.8+ PyPI Downloads

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

First, 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

Flags Default Description
-i/--inplace False Whether to compress PDFs in place.
-s/--suffix '-compressed' String to append to the filename of compressed PDFs. Mutually exclusive with --inplace.
--cl/--compression-level 'recommended' How hard to squeeze the file size. One of ("low", "recommended", "extreme"). 'extreme' noticeably degrades quality of embedded bitmap images.
--set-api-key Set the public key needed to authenticate with the iLovePDF API. You only need to do this once to start using.
--report-quota Report the number of remaining file operations in the current billing cycle for the stored iLovePDF API key.
--debug False When true, iLovePDF won't process the request but only reports the parameters that would have been sent to the server.
-v/--version Get the version number of pdf-compressor.

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.5.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

pdf_compressor-0.1.5-py2.py3-none-any.whl (10.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pdf-compressor-0.1.5.tar.gz.

File metadata

  • Download URL: pdf-compressor-0.1.5.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for pdf-compressor-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5911dd8d890f4a248f07309a25bf1e079899844928c4a0b22baadbe69109f0cd
MD5 316901164afd071cc44b91787fad3219
BLAKE2b-256 840f18a8701fadded2b7f6dde5512b161fefcf8c4fa628b8709875c6c68b7cb9

See more details on using hashes here.

File details

Details for the file pdf_compressor-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: pdf_compressor-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for pdf_compressor-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d602aef011adaea4c1cbf8da3441e76a3aafd1aaf3838c5cbc98535e31de4cf1
MD5 d0b92e52a210c87235dd7b40e30039eb
BLAKE2b-256 7f947b7d1be1a428a655ed2fb52a84e4c70bd60003bbd1391b88bdbb71284327

See more details on using hashes here.

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