Metadata-Version: 2.4
Name: immich
Version: 1.1.0
Summary: Unofficial Python client for Immich
Keywords: immich,photos,backup,client,api
Author: Immich Python Client
Author-email: Immich Python Client <contact@timonrieger.de>
License-Expression: MIT
License-File: LICENSE
Classifier: Topic :: Multimedia
Classifier: Topic :: Software Development :: Libraries
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: aiohttp>=3.8.4,<4.0.0
Requires-Dist: aiohttp-retry>=2.8.3,<3.0.0
Requires-Dist: pydantic>=2.0.0,<3.0.0
Requires-Dist: python-dateutil>=2.8.2,<3.0.0
Requires-Dist: requests>=2.32.0,<3.0.0
Requires-Dist: tqdm>=4.67.0,<5.0.0
Requires-Dist: typing-extensions>=4.7.1,<5.0.0
Requires-Dist: urllib3>=1.25.3,<3.0.0
Requires-Dist: uv==0.9.21 ; extra == 'build'
Requires-Python: >=3.10
Project-URL: Changelog, https://github.com/timonrieger/immich-python-client/releases
Project-URL: Repository, https://github.com/timonrieger/immich-python-client
Provides-Extra: build
Description-Content-Type: text/markdown

# Immich API Client

<p align="center">
    <a href="https://coderabbit.ai" target="_blank" rel="noopener noreferrer">
        <img src="https://img.shields.io/coderabbit/prs/github/timonrieger/immich-python-client?utm_source=oss&utm_medium=github&utm_campaign=timonrieger%2Fimmich-python-client&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews" alt="CodeRabbit Pull Request Reviews">
    </a>
    <a href="https://github.com/timonrieger/immich-python-client/actions/workflows/test.yml">
        <img src="https://github.com/timonrieger/immich-python-client/actions/workflows/test.yml/badge.svg" alt="Tests">
    </a>
    <a href="https://pypi.org/project/immich" target="_blank" rel="noopener noreferrer">
        <img src="https://img.shields.io/pypi/v/immich?color=%2334D058&label=pypi%20package" alt="Package version">
    </a>
    <a href="https://pypi.org/project/immich" target="_blank" rel="noopener noreferrer">
        <img src="https://img.shields.io/pypi/pyversions/immich.svg?color=%2334D058" alt="Supported Python versions">
    </a>
</p>

Unofficial Python client for the [Immich](https://immich.app) API.

> [!IMPORTANT]
> This repository is **auto-generated** from the Immich OpenAPI specification.
> **Do not open pull requests**. See [CONTRIBUTING](CONTRIBUTING.md) for more details.

## Status

- **Unofficial**: Not affiliated with or endorsed by Immich.
- **Auto-synced**: Kept in sync with the **latest Immich release** (regenerated as upstream changes land).

## Installation

You need Python 3.10–3.14 installed to be able to use this library.

Install the latest stable version from PyPI:

```bash
pip install immich
```

If you want the latest version (which may be a pre-release):

```bash
pip install --pre immich
```

## Structure

This SDK is **async-only**. The client exposes API groups as attributes, and endpoints as methods on those groups. Groups and endpoints are documented in the [Immich API documentation](https://api.immich.app/endpoints).

## Authentication

Immich supports API keys. Create one in your server and pass it via `api_key=...`. Cookie and Bearer tokens are also supported.

## Usage

With a context manager (recommended):

```python
from immich import AsyncClient

async with AsyncClient(api_key="your-immich-api-key", base_url="http://localhost:2283/api") as client:
    await client.server.get_about_info()
```

Without a context manager:

```python
import asyncio
from immich import AsyncClient

async def main():
    client = AsyncClient(api_key="your-immich-api-key", base_url="http://localhost:2283/api")
    try:
        await client.server.get_about_info()
    finally:
        await client.close()

asyncio.run(main())
```

## Response Types

There are three different available output formats you can choose from:

### Serialized Response

You can get fully serialized responses as Pydantic models. Using this, you get the full benefits of Pydantic's type checking.

```python
res = await client.server.get_about_info()
```

The output would look like this:

```python
ServerAboutResponseDto(...)
```

### Serialized Response with HTTP Info

```python
res = await client.server.get_about_info_with_http_info()
```

The output would look like this:

```python
status_code=200 headers={'Content-Type': 'application/json'} data=ServerAboutResponseDto(...) raw_data=b'{"...": "..."}'
```

### JSON Response

You can receive a classical JSON response by suffixing the function name with `_without_preload_content`:

```python
response = await client.server.get_about_info_without_preload_content()
await response.json()
```

## Session management

The client can manage a shared `aiohttp.ClientSession`, or you can pass your own via `http_client=...` (you are responsible for its lifecycle).

## Versioning

This package follows **[Semantic Versioning](https://semver.org)**.

- **Package version is not the server version**: `immich` package `X.Y.Z` is the client’s own version.
- **Upstream breaking changes ⇒ major bump**: Breaking Immich changes that require breaking client changes produce a new **major** version.
- **Supported Immich server version**: `IMMICH-VERSION` (repo root) tracks the Immich version this client was generated from.
  - If you run an **older** Immich server version, you can install an **older** `immich` package release where `IMMICH-VERSION` matches your server.
  - This client supports **Immich v2.4.1** and above.
