A python module for the Open Glider Network
Project description
A python3 module for the Open Glider Network. It can be used to connect to the OGN-APRS-Servers and to parse APRS-/OGN-Messages.
A full featured gateway with build-in database is provided by ogn-python.
Example Usage
Parse APRS/OGN packet.
from ogn.parser import parse_aprs, parse_ogn_beacon from datetime import datetime beacon = parse_aprs("FLRDDDEAD>APRS,qAS,EDER:/114500h5029.86N/00956.98E'342/049/A=005524 id0ADDDEAD -454fpm -1.1rot 8.8dB 0e +51.2kHz gps4x5", reference_date=datetime(2016,1,1,11,46)) beacon.update(parse_ogn_beacon(beacon['comment']))
Connect to OGN and display all incoming beacons.
from ogn.client import AprsClient from ogn.parser import parse_aprs, parse_ogn_beacon, ParseError def process_beacon(raw_message): if raw_message[0] == '#': print('Server Status: {}'.format(raw_message)) return try: beacon = parse_aprs(raw_message) beacon.update(parse_ogn_beacon(beacon['comment'])) print('Received {beacon_type} from {name}'.format(**beacon)) except ParseError as e: print('Error, {}'.format(e.message)) client = AprsClient(aprs_user='N0CALL') client.connect() try: client.run(callback=process_beacon, autoreconnect=True) except KeyboardInterrupt: print('\nStop ogn gateway') client.disconnect()
License
Licensed under the AGPLv3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ogn-client-0.4.0.tar.gz
(24.4 kB
view hashes)
Built Distribution
ogn_client-0.4.0-py3-none-any.whl
(10.8 kB
view hashes)
Close
Hashes for ogn_client-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91bb01a7137985f18cbc4d7e90510464876ffa73c0a8892800bd6325e8af2012 |
|
MD5 | bd07c0ca2e000d0d9c74a6f4dfca854f |
|
BLAKE2b-256 | a0a421917599a7c9040615367e29e5a0bb27ab3d72bcab1e674ce14c136f04a1 |