A python module for the Open Glider Network
Project description
# python-ogn-client
[![Build Status](https://travis-ci.org/glidernet/python-ogn-client.svg?branch=master)](https://travis-ci.org/glidernet/python-ogn-client)
[![PyPi Version](https://img.shields.io/pypi/v/ogn-client.svg)](https://pypi.python.org/pypi/ogn-client)
[![Coverage Status](https://coveralls.io/repos/github/glidernet/python-ogn-client/badge.svg?branch=master)](https://coveralls.io/github/glidernet/python-ogn-client?branch=master)
A python3 module for the [Open Glider Network](http://wiki.glidernet.org/).
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](https://github.com/glidernet/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 date, time
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_date=date(2016,1,1), reference_time=time(11,46))
```
Connect to OGN and display all incoming beacons.
```
from ogn.client import AprsClient
from ogn.parser import parse, ParseError
def process_beacon(raw_message):
if raw_message[0] == '#':
print('Server Status: {}'.format(raw_message))
return
try:
beacon = parse(raw_message)
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](LICENSE).
[![Build Status](https://travis-ci.org/glidernet/python-ogn-client.svg?branch=master)](https://travis-ci.org/glidernet/python-ogn-client)
[![PyPi Version](https://img.shields.io/pypi/v/ogn-client.svg)](https://pypi.python.org/pypi/ogn-client)
[![Coverage Status](https://coveralls.io/repos/github/glidernet/python-ogn-client/badge.svg?branch=master)](https://coveralls.io/github/glidernet/python-ogn-client?branch=master)
A python3 module for the [Open Glider Network](http://wiki.glidernet.org/).
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](https://github.com/glidernet/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 date, time
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_date=date(2016,1,1), reference_time=time(11,46))
```
Connect to OGN and display all incoming beacons.
```
from ogn.client import AprsClient
from ogn.parser import parse, ParseError
def process_beacon(raw_message):
if raw_message[0] == '#':
print('Server Status: {}'.format(raw_message))
return
try:
beacon = parse(raw_message)
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](LICENSE).
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.8.2.tar.gz
(47.7 kB
view hashes)
Built Distribution
ogn_client-0.8.2-py3-none-any.whl
(18.4 kB
view hashes)
Close
Hashes for ogn_client-0.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb1bc38af5a89c5948bd085ea0a6f1a4a6d84cd7d370d6d03c284d747e68053c |
|
MD5 | 249dfff649cb8c021a334c2850feec7c |
|
BLAKE2b-256 | 4a485135587c5a736d376f3f18aa1c69ae6f1a2b135ed33ddfc4f162ceb06b42 |