Skip to main content

base-aprs-client

Base layer for building APRS client applications in Python, on top of aprs3, kiss3 and ax253.

AsyncClient (asyncio) and Client (its synchronous wrapper) implement the APRS station semantics that every application needs:

  • sending messages, with acknowledgement and timed retries
  • acknowledging incoming messages addressed to mycall, and delivering each one once even when the sender retries
  • reply-acks, on by default
  • splitting long messages on word boundaries, or truncating them
  • sending status and position reports
  • reconnecting with backoff when the connection drops, keeping unacknowledged messages
  • with a PacketStore, logging every frame and sending queued frames when they are due, even across restarts

It works over APRS-IS, KISS-over-TCP (e.g. Dire Wolf) or a serial KISS TNC.

Example

import asyncio
from base_aprs_client import AsyncClient


async def main():
    async with AsyncClient.aprsis(
        "N0CALL-1",
        passcode="-1",  # use a real passcode to transmit
        filter="r/46.1/-122.9/50",
    ) as client:
        client.send_status("Hello from base-aprs-client")
        await client.send_message("N0CALL-2", "hi", ack=True)  # waits for the ack
        async for frame in client:
            print(frame)


asyncio.run(main())

The synchronous Client runs the same client on a background thread:

from base_aprs_client import Client

with Client.kiss_tcp("N0CALL-1", "localhost", 8001) as client:
    ack = client.send_message("N0CALL-2", "hi", ack=True)
    print(ack.result(timeout=60))
    for frame in client.read(min_frames=1):
        print(frame)

Client(mycall, sync_frame_io) with an already started aprs.TCP, aprs.TCPKISS or aprs.SerialKISS still works as before; its event loop only runs inside the client's calls.

Local testing without a radio

APRSISSimulator is a tiny APRS-IS-like relay: every line one client sends is forwarded to all the others.

from aprs import TCP
from base_aprs_client import APRSISSimulator, Client

with APRSISSimulator() as sim:
    with TCP(host=sim.host, port=sim.port) as t1, TCP(host=sim.host, port=sim.port) as t2:
        sim.wait_for_clients(2)
        alice = Client("N0CALL-1", t1)
        bob = Client("N0CALL-2", t2)
        alice.send_message(bob.mycall, "hi bob")
        print(bob.read(min_frames=1))

Run it standalone on port 14588 with python -m base_aprs_client.simulator.

Examples

The examples directory has two scripts that work over APRS-IS (--aprsis host:port), a KISS TNC on TCP (--tcp host:port) or a serial TNC (--serial device):

  • send_message.py sends one message and waits for the ack, splitting long text into parts. It uses Client.
  • chat.py is a terminal chat: each line you type goes to --to, and messages addressed to you are printed as they arrive. It uses AsyncClient.

Start python -m base_aprs_client.simulator and point two copies of chat.py at --aprsis localhost:14588 to try them without a radio.

Packet log and send queue

base_aprs_client.store.PacketStore keeps a log of frames heard and sent, and a queue of frames to transmit later. It uses SQLAlchemy 2.0 with an async session, so it never blocks the event loop; SQLite through aiosqlite is the default, and any async SQLAlchemy URL works. Install with pip install base-aprs-client[db].

Give it to a client to log everything it hears and sends, and to transmit frames scheduled with client.schedule(frame, delay=...):

from aprs import InformationField
from base_aprs_client import AsyncClient
from base_aprs_client.store import PacketStore

async with PacketStore("sqlite+aiosqlite:///N0CALL.db") as store:
    async with AsyncClient.aprsis("N0CALL-1", passcode="12345", store=store) as client:
        await client.schedule(InformationField.from_bytes(b">QRT soon"), delay=600)

The store can also be used on its own:

from base_aprs_client.store import PacketStore

async with PacketStore("sqlite+aiosqlite:///N0CALL.db") as store:
    await store.record_received(frame)
    await store.schedule(reply, delay=10)
    for record in await store.due():
        if await store.claim(record):  # False if another task already sent it
            transport.write(record.frame)

Development

uv sync --all-extras
uv run pytest

CI runs the suite on every supported Python (3.11+). The KISS tests run a serial TNC on a pseudo-terminal, and send through Dire Wolf when it is installed (apt install direwolf); they are skipped otherwise. Lint and format with uv run ruff check and uv run ruff format, type-check with uv run ty check.

Metadata

Release files for base-aprs-client 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for base-aprs-client 0.0.1
File Size Uploaded Provenance Actions
base_aprs_client-0.0.1.tar.gz 893.3 kB Without provenance Details for base_aprs_client-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for base-aprs-client 0.0.1
File Interpreter ABI Platform Actions
base_aprs_client-0.0.1-py3-none-any.whl Python 3 none any Details for base_aprs_client-0.0.1-py3-none-any.whl

Total release size: 919.3 kB

Release files / base_aprs_client-0.0.1.tar.gz

Download URL base_aprs_client-0.0.1.tar.gz
Size 893.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3c65814309635da60321619f07fa4f4c6462ee5ff21bdb152da08c48b7b27f84
BLAKE2b-256 checksum
How to use checksums
c329635dc49df41c5133e8007de3bdee030ab391222d8a2e564f1c73600f2b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / base_aprs_client-0.0.1-py3-none-any.whl

Download URL base_aprs_client-0.0.1-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa7c036e99d4d39e78336c2503a2c5dbc9f0dc4ab2ac300a1f6d8dc81004edee
BLAKE2b-256 checksum
How to use checksums
d1762ae9bbe8a6fcfd2fe8d800ef5c86938011435d26647110ab55ddb775123d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for base-aprs-client 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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