Skip to main content

Test codecov Library version Supported versions Formated with Black

aioimmich

Asynchronous library to fetch albums and assests from immich. The main purpose of this library is the integration of an immich instance into Home Assistant.

:warning: this is in early development state :warning:

breaking changes may occure at every time.

Requirements

  • Python >= 3.11
  • aiohttp

Installation

pip install aioimmich

Examples

Get all albums

import asyncio
import aiohttp
from aioimmich import Immich


async def main():
    async with aiohttp.ClientSession() as session:
        immich = Immich(session, "<API-KEY>", "<IMMICH-IP>")
        await immich.async_setup()

        for album in await immich.albums.async_get_all_albums():
            print(f"Album: {album.album_name} contains {album.asset_count} assets")


if __name__ == "__main__":
    asyncio.run(main())

Download an asset

import asyncio
import aiohttp
from aioimmich import Immich


async def main():
    async with aiohttp.ClientSession() as session:
        immich = Immich(session, "<API-KEY>", "<IMMICH-IP>")
        await immich.async_setup()

        asset_bytes = await immich.assets.async_view_asset("<ASSET-ID>", size="fullsize")
        with open(f"my_nice_picture.jpg", "wb") as fh:
            fh.write(asset_bytes)


if __name__ == "__main__":
    asyncio.run(main())

Get server info

import asyncio
import aiohttp
from aioimmich import Immich


async def main():
    async with aiohttp.ClientSession() as session:
        immich = Immich(session, "<API-KEY>", "<IMMICH-IP>")
        await immich.async_setup()

        about_info = await api.server.async_get_about_info()
        print(f"Version:       {about_info.version}")
        print(f"Is licensed:   {about_info.licensed}")

        storage_info = await api.server.async_get_storage_info()
        print(f"Disk Available:       {storage_info.disk_available}")
        print(f"Disk Available (raw): {storage_info.disk_available_raw} bytes")
        print(f"Disk Size:            {storage_info.disk_size}")
        print(f"Disk Size (raw):      {storage_info.disk_size_raw} bytes")
        print(f"Disk Usage:           {storage_info.disk_usage_percentage}%")
        print(f"Disk Use:             {storage_info.disk_use}")
        print(f"Disk Use (raw):       {storage_info.disk_use_raw} bytes")


if __name__ == "__main__":
    asyncio.run(main())

References


You like my work?

Buy Me A Coffee

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioimmich-0.16.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file aioimmich-0.16.3-py3-none-any.whl.

File metadata

  • Download URL: aioimmich-0.16.3-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aioimmich-0.16.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b37003fe9dd30c46f62ebc3bbf5a736bd725b9fa0a1699864b1d16e7a424b941
MD5 caeecbda8f27bc2be208100b89f054ec
BLAKE2b-256 5402082e747a7cf8baa57804809a7040a13f130c2eb6def651a7ae0ea4c6e735

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioimmich-0.16.3-py3-none-any.whl:

Publisher: release.yaml on mib1185/aioimmich

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page