Skip to main content

A python module for the Open Glider Network

Project description

python-ogn-client

build PyPi Version

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.

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, 7, 31, 12, 34, 56))

Connect to OGN and display all incoming beacons.

from ogn.client import AprsClient
from ogn.parser import parse, AprsParseError

def process_beacon(raw_message):
    try:
        beacon = parse(raw_message)
        print('Received {aprs_type}: {raw_message}'.format(**beacon))
    except AprsParseError 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


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-2.0.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

ogn_client-2.0.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file ogn_client-2.0.0.tar.gz.

File metadata

  • Download URL: ogn_client-2.0.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ogn_client-2.0.0.tar.gz
Algorithm Hash digest
SHA256 2bd0396b9e287790fe396c882fd44a2ac64f5ece28093961cc0cf6b0babe354f
MD5 efcf8973d0596a36466e7786fbec65b9
BLAKE2b-256 f7486405d18829403488cb303e1c87a0154edca62ad2d8dbe5d4efe3edc884b0

See more details on using hashes here.

File details

Details for the file ogn_client-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ogn_client-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ogn_client-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a847e6cf7513a0526c77de151c8273813ae6058ea83b69a61f1b51fdd63dae
MD5 f569ba53a33d722f347702be15554411
BLAKE2b-256 f119fd7d09c250e514919769de1cacb42e8985b6964d4ec18a84b7693a4bdb6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page