Metadata-Version: 2.5
Name: easypics-sdk
Version: 0.0.1
Summary: Official Python SDK for the EasyPics Developer API.
Project-URL: Homepage, https://easypics.lol/developers
Project-URL: Documentation, https://easypics.lol/developers
Project-URL: Repository, https://github.com/Septy-Studios/easypics-python
Project-URL: Issues, https://github.com/Septy-Studios/easypics-python/issues
Author: Septy Studios
License: MIT License
        
        Copyright (c) 2026 Septy Studios
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: api,easypics,image-hosting,media,python,sdk
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Requires-Dist: typing-extensions>=4.12
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# EasyPics Python SDK

Official Python SDK for the [EasyPics Developer API](https://easypics.lol/developers).

Current status: early development (`0.0.x`). The SDK API may change between releases.

EasyPics API keys are server-side credentials. Do not expose them in client applications or public repositories.

## Install

```bash
pip install easypics-sdk
```

Python 3.10 or newer is required.

## Quick start

```python
import os

from easypics import EasyPics

with EasyPics(api_key=os.environ["EASYPICS_API_KEY"]) as easypics:
    media = easypics.media.upload(
        "./image.png",
        visibility="UNLISTED",
    )

    print(media.url)
```

API access is request-only. See the [Developer API page](https://easypics.lol/developers) for access requirements and current limits.

## Albums

```python
album = easypics.albums.create(
    title="Project Screenshots",
    visibility="UNLISTED",
)

media = easypics.media.upload(
    "./build.png",
    album_id=album.id,
)
```

Available album methods:

```python
easypics.albums.create(...)
easypics.albums.list(limit=20, cursor=None)
easypics.albums.get(album_id)
easypics.albums.update(album_id, ...)
easypics.albums.delete(album_id)
easypics.albums.list_media(album_id, limit=20, cursor=None)
easypics.albums.attach_media(album_id, media_id)
easypics.albums.remove_media(album_id, media_id)
```

## Upload inputs

`media.upload()` accepts a filesystem path, bytes-like object, or binary file object.

When uploading raw bytes or a nameless file object, pass `file_name` explicitly.

```python
media = easypics.media.upload(
    image_bytes,
    file_name="avatar.png",
    title="Avatar",
    visibility="PRIVATE",
)
```

## Errors

API and transport failures raise `EasyPicsError`.

```python
from easypics import EasyPicsError

try:
    easypics.albums.list()
except EasyPicsError as error:
    print(error.code, error.status)

    if error.retry_after is not None:
        print(f"Retry after {error.retry_after}s")
```

The SDK does not automatically retry requests. Some EasyPics operations create resources, so retry policy is left to the application instead of risking duplicate work.

## Development

```bash
python -m pip install -e ".[dev]"
pytest
ruff check .
python -m build
```

## License

MIT
