Skip to main content

Asyncio-native Python client for the TrueNAS JSON-RPC WebSocket API

Project description

aiotruenas

Asyncio-native Python client for the TrueNAS JSON-RPC 2.0 WebSocket API (ws(s)://<host>/api/current, TrueNAS 25.04+).

No dependency on Home Assistant or any other framework — usable as a standalone library.

Installation

pip install .

Usage

import asyncio

from aiotruenas import TrueNASClient


async def main() -> None:
    async with TrueNASClient("truenas.local", "1-abcdef...") as client:
        info = await client.call("system.info")
        print(info)


asyncio.run(main())

call() is a generic RPC surface — pass any TrueNAS JSON-RPC method name and its params (list or dict). Long-running operations that return a job id (scrub, replication, dataset lock/unlock, ...) can be polled automatically with job=True:

await client.call("pool.scrub.scrub", ["tank", "START"], job=True)

Connection and protocol failures are raised as typed exceptions (see aiotruenas.exceptions) rather than returned as an error code/string, so callers can except TrueNASAuthenticationError, except TrueNASConnectionError, etc.

Status

Early development (v1: generic call surface only, no typed per-domain convenience methods yet). See PROMPT.md for the full design brief and CLAUDE.md for repo guidance.

License

Apache-2.0, see LICENSE.

Project details


Download files

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

Source Distribution

aiotruenas-1.0.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

aiotruenas-1.0.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file aiotruenas-1.0.0.tar.gz.

File metadata

  • Download URL: aiotruenas-1.0.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aiotruenas-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cb685a2867754bb59c7b1bde4be4159a9466835d643d6e8586dc5351e3de7c81
MD5 1f0712e13924157cee151be1ed7ee83e
BLAKE2b-256 160764c07bd2a282723c3c61605f0343e12ac7b75a6f55e56efe624e544e7b3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiotruenas-1.0.0.tar.gz:

Publisher: pypi.yaml on kayl-codes/aiotruenas

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

File details

Details for the file aiotruenas-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for aiotruenas-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5d4f97ba4165525f7bffb1c4feeaf5ce27affb1f26a78ff6f9e15855f29c758
MD5 c8a5d8659759303983a7869a8fa4e758
BLAKE2b-256 53a82665f9124bb62993be6021be48163f11089714f25f73bb7f6d3a777aa83c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiotruenas-1.0.0-py3-none-any.whl:

Publisher: pypi.yaml on kayl-codes/aiotruenas

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 Pingdom Monitoring Sentry Error logging StatusPage Status page