Python api client made for ILoveIMG & ILovePDF based on ILoveAPI (https://www.iloveapi.com/docs/api-reference).
Project description
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.add_file("p1.png")
task.process()
task.download("output.png")
Directly call REST API:
response = client.rest.start("compressimage") # getting httpx response
response = await client.rest.start_async("compressimage") # async
Async support:
task = await client.create_task_async("compressimage")
await task.add_file_async("p1.png")
await task.process_async()
await task.download_async("output.png")
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iloveapi-0.1.3.tar.gz.
File metadata
- Download URL: iloveapi-0.1.3.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.0 CPython/3.10.14 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d1c3266cb9c641d59a44ea206468937683da4dd3262d2c6e4b6917766f8fcb3
|
|
| MD5 |
7d27b7f919d6f09b72183ea4637b8aae
|
|
| BLAKE2b-256 |
402e91c747b07314619465366ad0bde2c35acf136ca7e57e1a58b5175f049835
|
File details
Details for the file iloveapi-0.1.3-py3-none-any.whl.
File metadata
- Download URL: iloveapi-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.0 CPython/3.10.14 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9893c8085774aafa8a006d9e5cf99f0d6b8bd4eef84710d72ac9ccbba20a0e59
|
|
| MD5 |
a5ced96b741a09990abc98ce2aee3220
|
|
| BLAKE2b-256 |
406e13c199c3d2e5556e2f52c5630511628465e3cbe9dfb7b405e80b8e3e136c
|