iloveapi


Nameiloveapi JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryPython api client made for iLoveIMG & iLovePDF based on iLoveAPI (https://www.iloveapi.com/docs/api-reference).
upload_time2024-12-20 09:35:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords iloveapi iloveimg ilovepdf api sdk client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```shell
pip install iloveapi
```

## Getting Started

Simply compress image:

```python
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:

```python
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:

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

Directly call REST API:

```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "iloveapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "iloveapi, iloveimg, ilovepdf, api, sdk, client",
    "author": null,
    "author_email": "iyume <iyumelive@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/02/59/31abad728b2c4fa1d085d8c1bab4e4709805869b5c9c7c063038be0becac/iloveapi-0.1.4.tar.gz",
    "platform": null,
    "description": "# iloveapi-python\n\nPython api client made for iLoveIMG & iLovePDF based on iLoveAPI (https://www.iloveapi.com/docs/api-reference).\n\n## Features\n\n- Fully typed code\n- Asyncio support\n- REST API & workflow API encapsulation\n\n## Installation\n\n```shell\npip install iloveapi\n```\n\n## Getting Started\n\nSimply compress image:\n\n```python\nfrom iloveapi import ILoveApi\n\nclient = ILoveApi(\n    public_key=\"<project_public_******>\",\n    secret_key=\"<secret_key_******>\",\n)\ntask = client.create_task(\"compressimage\")\ntask.process_files(\"p1.png\")\ntask.download(\"output.png\")\n```\n\nMultiple images:\n\n```python\ntask = client.create_task(\"compressimage\")\ntask.process_files(\n    \"p1.png\",\n    (\"custom_name.png\", \"p2.png\"),\n    (\"custom_name.png\", b\"..PNG...\"),\n    {\n        \"file\": b\"..PNG...\",\n        \"filename\": \"custom_name.png\",\n        \"rotate\": 2,  # add image parameter\n        \"password\": \"xxx\",  # for PDF\n    }\n)\ntask.download(\"output.zip\")  # zip format\n```\n\nAsync support:\n\n```python\ntask = await client.create_task_async(\"compressimage\")\nawait task.process_files_async(\"p1.png\")\nawait task.download_async(\"output.png\")\n```\n\nDirectly call REST API:\n\n```python\nresponse = client.rest.start(\"compressimage\")  # getting httpx response\nresponse = await client.rest.start_async(\"compressimage\")  # async\n```\n\n## TODO\n\n- [ ] Typed parameter for all processing tools\n- [ ] Command-line interface\n\n## Why not pydantic?\n\nImage / PDF processing tools usually focus on results rather than JSON data, as data type validation is not important to the user.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python api client made for iLoveIMG & iLovePDF based on iLoveAPI (https://www.iloveapi.com/docs/api-reference).",
    "version": "0.1.4",
    "project_urls": {
        "homepage": "https://github.com/iyume/iloveapi-python",
        "repository": "https://github.com/iyume/iloveapi-python.git"
    },
    "split_keywords": [
        "iloveapi",
        " iloveimg",
        " ilovepdf",
        " api",
        " sdk",
        " client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a3e3f5bca42e20456715f63965a49ca89fea6b9e9c94fa1381d5b4078f34c0f",
                "md5": "64869071fdfcde8ef0fc9c4f4552814a",
                "sha256": "737960554376be11b8fefd3382ac7a5c8591d21c5178281089a65f32d05a49e3"
            },
            "downloads": -1,
            "filename": "iloveapi-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64869071fdfcde8ef0fc9c4f4552814a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9346,
            "upload_time": "2024-12-20T09:35:34",
            "upload_time_iso_8601": "2024-12-20T09:35:34.557674Z",
            "url": "https://files.pythonhosted.org/packages/9a/3e/3f5bca42e20456715f63965a49ca89fea6b9e9c94fa1381d5b4078f34c0f/iloveapi-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "025931abad728b2c4fa1d085d8c1bab4e4709805869b5c9c7c063038be0becac",
                "md5": "5618904d03825f1da2d646d7312f2042",
                "sha256": "7efd3b2b9c849c69931d7b5bd2cf0e48bd2b0c8c10ff2c349a60b1e9a8f3a0d9"
            },
            "downloads": -1,
            "filename": "iloveapi-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5618904d03825f1da2d646d7312f2042",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7812,
            "upload_time": "2024-12-20T09:35:35",
            "upload_time_iso_8601": "2024-12-20T09:35:35.720697Z",
            "url": "https://files.pythonhosted.org/packages/02/59/31abad728b2c4fa1d085d8c1bab4e4709805869b5c9c7c063038be0becac/iloveapi-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 09:35:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iyume",
    "github_project": "iloveapi-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "iloveapi"
}
        
Elapsed time: 0.43430s