A python module for the Open Glider Network
Project description
python-ogn-client
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.
Installation
python-ogn-client is available at PyPI. So for installation simply use pip:
pip install ogn-client
Example Usage
Parse APRS/OGN packet.
from ogn.parser import parse
from datetime import datetime
beacon = parse("FLRDDDEAD>APRS,qAS,EDER:/114500h5029.86N/00956.98E'342/049/A=005524 id0ADDDEAD -454fpm -1.1rot 8.8dB 0e +51.2kHz gps4x5",
reference_timestamp=datetime(2015, 07, 31, 12, 34, 56))
Connect to OGN and display all incoming beacons.
from ogn.client import AprsClient
from ogn.parser import parse, ParseError
def process_beacon(raw_message):
try:
beacon = parse(raw_message)
print('Received {aprs_type}: {raw_message}'.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()
Connect to telnet console and display all decoded beacons.
from ogn.client import TelnetClient
from ogn.parser.telnet_parser import parse
def process_beacon(raw_message):
beacon = parse(raw_message)
if beacon:
print(beacon)
client = TelnetClient()
client.connect()
try:
client.run(callback=process_beacon)
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.9.5.tar.gz
(65.9 kB
view hashes)
Built Distribution
ogn_client-0.9.5-py3-none-any.whl
(31.5 kB
view hashes)
Close
Hashes for ogn_client-0.9.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d18101f16d6ddb8ccf7c9de0e43216949be61de1ffa00f99774c9a47402b563 |
|
MD5 | 30a84b52fb0efb4f50bc41a25d1e0242 |
|
BLAKE2b-256 | 0cadf010a1ed57ff8a7fc1e3f2d1e94cd320e0c1848e0de3dd9ea6ad4cdc42d1 |