/
View dependency graph
Depends on
- aiofiles (python3-aiofiles)
- debhelper (dh-sequence-single-binary)
- dh-python (dh-sequence-python3, pybuild-plugin-pyproject)
- pytest (python3-pytest)
- python-aiointercept (python3-aiointercept)
- python-mashumaro (python3-mashumaro)
- python-pytest-asyncio (python3-pytest-asyncio)
- python-pytest-cov (python3-pytest-cov)
- python-syrupy (python3-syrupy)
- python3-defaults (python3-all)
- setuptools (python3-setuptools)
- debhelper-compat, python3-aiohttp
README (full)
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?
| dir | .devcontainer/ |
| dir | .github/ |
| dir | aioimmich/ |
| dir | debian/ |
| dir | html/ |
| dir | tests/ |
| file | .gitignore |
| file | .pre-commit-config.yaml |
| file | LICENSE |
| file | README.md |
| file | docs |
| file | pyproject.toml |
| file | requirements.txt |
| file | requirements_dev.txt |