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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iloveapi-1.0.0.tar.gz | 7.8 kB | Without provenance | Details for iloveapi-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iloveapi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for iloveapi-1.0.0-py3-none-any.whl |
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
|
Security for iloveapi 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.