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.
--verbose False When true, progress will be reported while tasks are running.
-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.8.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

pdf_compressor-0.1.8-py2.py3-none-any.whl (12.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pdf-compressor-0.1.8.tar.gz
  • Upload date:
  • Size: 11.4 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.8.tar.gz
Algorithm Hash digest
SHA256 6c9a1cb0bce1af185f03a3dac8d300d8de8553c65bde8e79e62e053b2a85c288
MD5 32bcecd748d7205d10959ca11b1b8163
BLAKE2b-256 4f2211745e4fd318c237873ef6757f25840ac4299b191937babb39a7d5c1aebd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf_compressor-0.1.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.0 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.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01039634be32b6ee566a37758291865534bcd81b74b5646770e927e1f116ccb8
MD5 96aca6bfc403e5c9244c10f69beb4cab
BLAKE2b-256 7caebdf3cf0c002347796921a64335abf0615f4a9de2de0cd8387fb454d834a7

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