Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
/ ilovepdf Public archive

Python module that wraps the iLovePDF REST API

Notifications You must be signed in to change notification settings

sdelquin/ilovepdf

Repository files navigation

iLovePDF

Python module that wraps the iLovePDF REST API.

Installation

$ git clone [email protected]:sdelquin/ilovepdf.git
$ cd ilovepdf
$ pipenv install

Set your settings in the .env file.

Usage

Using ilovepdf as a library

Example of compressing a file:

from ilovepdf import ILovePdf

i = ILovePdf(config.PUBLIC_KEY, config.SECRET_KEY)
i.new_task('compress')
i.add_file('input.pdf')
i.execute()
i.download('compressed_doc.pdf')

Using ilovepdf as a standalone script

Example of compressing a file:

$ python ipdf.py compress --verbose -o compressed_doc.pdf input.pdf

Disclaimer

Implemented tasks:

  • merge
  • split
  • compress
  • pdfjpg
  • imagepdf

Developer Keys

In order to work properly with the module, you will have to get the developer keys from https://developer.ilovepdf.com/. You will have to sign up and then go to Console -> My project. There you will find two keys:

  • Project key (JTI Claim) aka Public key.
  • Secret key.

Add these keys to .env file.

Tests

$> pytest

About

Python module that wraps the iLovePDF REST API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published