Skip to main content

a2al (Python)

Python client for A2AL — decentralized agent networking. Spawns a local a2ald daemon as a sidecar and exposes a typed REST helper covering the full API surface: identity, publish, discover, resolve, fetch, and multiplexed persistent tunnels.

Full API: doc/api-reference.md

Installation

pip install a2al

Pre-built a2ald binaries are bundled inside platform wheels:

Platform Architecture
Linux x86_64, arm64
macOS x86_64, arm64
Windows x86_64

On unsupported platforms, install a2ald manually and set A2ALD_PATH to the executable path.

Quick Start

from a2al import Daemon, Client

with Daemon() as d:
    c = Client(d.api_base, token=d.api_token)

    # 1 — Check daemon health
    print(c.health())

    # 2 — Send an HTTP request to a remote agent (encrypted QUIC, no local port needed)
    result = c.fetch(
        remote_aid,
        method="GET",
        path="/.well-known/agent.json",
    )
    # result = {"status": 200, "headers": {...}, "body": "<base64>", "truncated": False}

    # 3 — Open a persistent tunnel (multiple concurrent TCP connections)
    tunnel = c.tunnel_open(remote_aid)
    local_addr = tunnel["listen"]   # e.g. "127.0.0.1:58320"
    tunnel_id  = tunnel["id"]       # e.g. "tun_abc123"

    # ... connect your application to local_addr ...

    c.tunnel_close(tunnel_id)

Client API

Method REST endpoint Description
health() GET /health Daemon liveness check
resolve(aid) POST /resolve/{aid} Look up a remote agent's endpoints
connect(aid, *, local_aid) POST /connect/{aid} One-shot tunnel — single TCP session, closes automatically
fetch(aid, *, method, path, headers, body_base64, local_aid) POST /fetch/{aid} HTTP request over QUIC; returns {status, headers, body(base64), truncated}
tunnel_open(aid, *, local_aid, idle_timeout_sec) POST /tunnel/{aid} Persistent tunnel — accepts many concurrent connections; returns {id, listen}
tunnel_close(id) DELETE /tunnel/{id} Close a persistent tunnel
tunnel_list() GET /tunnel List active persistent tunnels
tunnel_status(id) GET /tunnel/{id} Status of one tunnel
agents_list() GET /agents List locally registered agents
identity_generate() POST /identity/generate Create a new Ed25519 AID
agent_register(payload) POST /agents Register a generated identity
agent_publish(aid) POST /agents/{aid}/publish Announce agent to the Tangled Network

Daemon Context Manager

Daemon() starts a2ald as a subprocess and stops it when the with block exits.

from a2al import Daemon, Client

# Default: auto-locate a2ald binary, random API port, temp data dir
with Daemon() as d:
    c = Client(d.api_base, token=d.api_token)
    ...

# Custom binary path and extra daemon flags
with Daemon(
    a2ald_exe="/usr/local/bin/a2ald",
    extra_args=["--data-dir", "/var/lib/a2al", "--fallback-host", "1.2.3.4"],
) as d:
    c = Client(d.api_base, token=d.api_token)
    ...

Environment Variables

Variable Description
A2ALD_PATH Override path to the a2ald executable
A2AL_API_TOKEN Bearer token when the daemon enforces authentication

Requirements

  • Python 3.10+
  • No third-party dependencies (standard library only)

Links

License

MPL-2.0

Download files

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

Source Distribution

a2al-0.3.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distributions

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

a2al-0.3.0-py3-none-win_amd64.whl (13.3 MB view details)

Uploaded Python 3Windows x86-64

a2al-0.3.0-py3-none-manylinux2014_x86_64.whl (6.2 MB view details)

Uploaded Python 3

a2al-0.3.0-py3-none-manylinux2014_aarch64.whl (5.7 MB view details)

Uploaded Python 3

a2al-0.3.0-py3-none-macosx_11_0_x86_64.whl (7.0 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

a2al-0.3.0-py3-none-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file a2al-0.3.0.tar.gz.

File metadata

  • Download URL: a2al-0.3.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for a2al-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b7fd6d2c1807cbb96dd39ec38b26a09b61d6291177dc14b819b0d54c36616d3d
MD5 f92a33a546857ce4e98db0a106a03578
BLAKE2b-256 310f210aeb0db02057e6cff74899f5ccd602d79ce8300cb335d4f87b43ca7ba3

See more details on using hashes here.

File details

Details for the file a2al-0.3.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: a2al-0.3.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for a2al-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 404082f0d0ea33405a76459fd9f851510ce899335a0a13d2fd95db7d3701745b
MD5 5b46dabc00fa4cc90b987b834891182c
BLAKE2b-256 060c5ce8525a2ffd3baebd5ea3a36a6df26bcacb2e04e0e895c437c3eecf96f9

See more details on using hashes here.

File details

Details for the file a2al-0.3.0-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for a2al-0.3.0-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 959e699f4e4cbba51be73375cf8cd5bb29663f4476fe78c7611bdc09c58646e8
MD5 394cad26502e82bd46ef46bc9ad4a6b8
BLAKE2b-256 0542492435cc23f2a1dfaebb2bcf4180301c4b5aeeb328a20c071015ee2993c6

See more details on using hashes here.

File details

Details for the file a2al-0.3.0-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for a2al-0.3.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a9fb9376f28ac789fd8029a710518d331156bc92c3351ab4371eaa04c940d8be
MD5 5e2dd0d2e3c3e2d20d1d392faa45ca99
BLAKE2b-256 d613ca7e9163d736e1cc20461769f2170b9f9407c474a03b649adf7b0a22209b

See more details on using hashes here.

File details

Details for the file a2al-0.3.0-py3-none-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: a2al-0.3.0-py3-none-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: Python 3, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for a2al-0.3.0-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9fc798d15b901518a6c08e8bfe5614a83de1aad896ea8cc13555d9638e986083
MD5 f233e66a17ac2e221e29a8fddce0686e
BLAKE2b-256 4d4ad9e43385678dd525af3ba7bb87f3a0539636918cc9a9921423e2b5915956

See more details on using hashes here.

File details

Details for the file a2al-0.3.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: a2al-0.3.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for a2al-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73a7663cfd9583696b939efdb8ebc8281d7a84948bdb7f1b1c82469a9a44d054
MD5 d490a45147969e31de5f93ad098f8314
BLAKE2b-256 308ae0bda31c702604ef9e32dcba569d639e07a841b3db5db4da461e9a981e67

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

6 files

0.2.9

6 files

0.2.8

6 files

0.2.7

6 files

0.2.6

6 files

0.2.5

6 files

0.2.4

6 files

0.2.3

6 files

0.2.2

6 files

0.2.1

6 files

0.2.0

6 files

0.1.9

6 files

0.1.8

6 files

0.1.7

6 files

0.1.6

6 files

0.1.5

6 files

0.1.2

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page