Skip to main content

iloveapi-python

Python api client made for iLoveIMG & iLovePDF based on iLoveAPI (https://www.iloveapi.com/docs/api-reference).

Features

  • Fully typed code
  • Asyncio support
  • REST API & workflow API encapsulation

Installation

pip install iloveapi

Getting Started

Simply compress image:

from iloveapi import ILoveApi

client = ILoveApi(
    public_key="<project_public_******>",
    secret_key="<secret_key_******>",
)
task = client.create_task("compressimage")
task.process_files("p1.png")
task.download("output.png")

Multiple images:

task = client.create_task("compressimage")
task.process_files(
    "p1.png",
    ("custom_name.png", "p2.png"),
    ("custom_name.png", b"..PNG..."),
    {
        "file": b"..PNG...",
        "filename": "custom_name.png",
        "rotate": 2,  # add image parameter
        "password": "xxx",  # for PDF
    }
)
task.download("output.zip")  # zip format

Async support:

task = await client.create_task_async("compressimage")
await task.process_files_async("p1.png")
await task.download_async("output.png")

Directly call REST API:

response = client.rest.start("compressimage")  # getting httpx response
response = await client.rest.start_async("compressimage")  # async

TODO

  • Typed parameter for all processing tools
  • Command-line interface

Why not pydantic?

Image / PDF processing tools usually focus on results rather than JSON data, as data type validation is not important to the user.

Metadata

Release files for iloveapi 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iloveapi 1.0.0
File Size Uploaded
iloveapi-1.0.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iloveapi 1.0.0
File Interpreter ABI Platform
iloveapi-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / iloveapi-1.0.0.tar.gz

Download URL iloveapi-1.0.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0237f95f6e150fa70de8b85ec01e85625f41022bcd659a7824d1d7acd8a4d440
BLAKE2b-256 checksum
How to use checksums
02a792902e2a7acd1c83264f556337cc264f6ed8128d2787a6fd0c820684b1a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.24.2 CPython/3.11.4 Linux/6.6.87.1-microsoft-standard-WSL2

Release files / iloveapi-1.0.0-py3-none-any.whl

Download URL iloveapi-1.0.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c14e65d5af370e287c302aa4cf5d5e751951cf33123b8b6b4b3586990b8d07ea
BLAKE2b-256 checksum
How to use checksums
f2d700095cd6e48a1ca9b909bac7dc4aa1c050af694ee1d85ea67dff338b797e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.24.2 CPython/3.11.4 Linux/6.6.87.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page