python-aprs

APRS for Python

python-aprs is a set of small, pure-Python libraries for building APRS-enabled applications: decode and encode packets, talk to a TNC over KISS, connect to APRS-IS, and run a station that sends and acknowledges messages. Everything is asyncio-first, with blocking wrappers where they are more convenient.

pip install aprs3

The libraries

Each layer builds on the one before it. Install only the layer you need; it pulls in the rest.

  1. AX.25 frames and TNC2 text format: encode, decode and stream-decode raw frames.

  2. KISS framing for TNCs over serial and TCP, with blocking and asyncio interfaces.

  3. APRS packet encoding and decoding, plus APRS-IS and KISS connections.

  4. base-aprs-client

    unreleased

    APRS station behaviour for applications: messaging with acks and retries, status and position reports, and a packet log.

A taste

import asyncio
from aprs import create_aprsis_connection

async def main():
    transport, protocol = await create_aprsis_connection(
        host="noam.aprs2.net",
        port=14580,
        user="N0CALL",
        passcode="-1",  # receive only; use your passcode to transmit
        command="filter r/46.1/-122.9/50",
    )
    async for frame in protocol.read():
        print(frame.source, frame.info)

asyncio.run(main())

The same frames can come from a radio instead: swap in aprs.create_serial_connection("/dev/ttyUSB0", 9600) for a serial KISS TNC or aprs.create_tcp_connection("localhost", 8001) for KISS over TCP (Direwolf, for example).

Recent releases