aiokarakeep
Async Python client for the Karakeep API.
This package is intended to provide the API communication layer for the
Karakeep Home Assistant integration. It accepts an injected aiohttp
ClientSession, which lets Home Assistant own connection pooling and lifecycle.
Requirements
- Python 3.11 or newer
aiohttp3.9 or newer
Installation
pip install aiokarakeep
Usage
from aiohttp import ClientSession
from aiokarakeep import KarakeepClient
async with ClientSession() as session:
client = KarakeepClient(
base_url="https://karakeep.example.com",
token="YOUR_API_TOKEN",
session=session,
)
stats = await client.async_get_stats()
API
KarakeepClient expects:
base_url: Karakeep instance URL, for examplehttps://karakeep.example.comtoken: Karakeep API tokensession: caller-ownedaiohttp.ClientSessiontimeout: optional request timeout in seconds, defaulting to15
Available methods:
async_get_stats()callsGET /api/v1/users/me/statsand returns the JSON object from Karakeep.async_get_health()callsGET /api/healthand returns the JSON object plusstatus_code. If the endpoint returns non-JSON content, the method returns{"status": "unknown", "status_code": ...}.async_get_version()callsGET /api/versionand returns the version string, orNonewhen the endpoint is unavailable or does not expose a version.
Exceptions
The client maps transport and response failures to typed exceptions:
KarakeepAuthError: Karakeep returned HTTP 401 or 403.KarakeepConnectionError: Karakeep could not be reached.KarakeepTimeoutError: the request timed out.KarakeepInvalidResponseError: Karakeep returned malformed or unexpected JSON.KarakeepApiError: Karakeep returned another HTTP error, oraiohttpreported a generic client error.
All package exceptions inherit from KarakeepError.
Development
uv run --extra test pytest -q
Build and check release artifacts:
uv run --extra release python -m build --installer uv
uv run --extra release twine check dist/*
See RELEASE_CHECKLIST.md before publishing a release to PyPI.
Metadata
Release files for aiokarakeep 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiokarakeep-0.3.0.tar.gz | 7.2 kB | With provenance | Details for aiokarakeep-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiokarakeep-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for aiokarakeep-0.3.0-py3-none-any.whl |
Total release size: 13.6 kB
Release files / aiokarakeep-0.3.0.tar.gz
| Download URL | aiokarakeep-0.3.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0760ac3c2ad84c89258814ef4f4f4bded93c7cf69016db623f2acc98ae29fe63
|
|
BLAKE2b-256 checksum How to use checksums |
be9037ab6ecc5894745bc4a96ec54d21e62abf4d670e26193e2ebc7e955c7def
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.
Transparency logRelease files / aiokarakeep-0.3.0-py3-none-any.whl
| Download URL | aiokarakeep-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7f7e0f171554d165d5db5308e3c1b8dac1a0474d119ef2f082cb514707c161e
|
|
BLAKE2b-256 checksum How to use checksums |
b5b073b1d8747ad8e35e9760c0e0bf394dc939ba899507a64b0bdfa3887e959b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.
Transparency logSecurity for aiokarakeep 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for aiokarakeep-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.