Introduction
AOGN is an Asynchronous OGN (Open Glider Network) client for modern Python. It connects to the APRS servers and receives the planes', gliders', receivers', etc. APRS messages, while still allowing you control of the program flow.
This can simplify programs since:
- There are no callback or blocking functions (e.g.
listen()orrun_forever()). - One script/thread/process can still do other useful out-of-band tasks like computing aggregate statistics and making web requests.
To interpret the raw OGN messages, use a function like
python-ogn-client's ogn.parser.parse.
Installation
pip install aogn
Usage
Basic example:
import asyncio
import logging
import sys
import aogn
logging.basicConfig(
stream=sys.stdout,
level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(module)s %(message)s',
datefmt='%b %d %H:%M:%S',
)
async def example() -> None:
conn = aogn.Client(aprs_user='NO-CALL', )
try:
while True:
# Get the APRS packet once available:
raw_message = await conn.packet()
logging.debug(raw_message)
except KeyboardInterrupt:
logging.info('OGN Gateway stopped.')
await conn.disconnect()
if __name__ == '__main__':
asyncio.run(example())
Concurrent example, with raw_message parsing:
import asyncio
import logging
import sys
logging.basicConfig(
stream=sys.stdout,
level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(module)s %(message)s',
datefmt='%b %d %H:%M:%S',
)
from aogn import Client
from ogn.parser import parse, ParseError
def process_beacon(raw_message):
beacon = {}
try:
beacon = parse(raw_message)
except ParseError as err:
logging.warning(f'ParseError: {err}')
except NotImplementedError as err:
logging.error(f'NotImplementedError: {err}')
except AttributeError as err:
logging.error(f'raw_message: {raw_message}')
logging.error(f'beacon: {beacon}')
logging.error(err)
return beacon
async def example() -> None:
conn = Client(aprs_user='NO-CALL', ) # aprs_filter='t/s')
try:
while True:
raw_message = await conn.packet()
if raw_message:
beacon = process_beacon(raw_message)
except KeyboardInterrupt:
logging.info('OGN Gateway stopped.')
await conn.disconnect()
async def another_io_function() -> None:
import random
while True:
sleep_duration = 120 * random.random()
logging.debug(f'Concurrently sleeping for {sleep_duration:.0f} seconds...')
await asyncio.sleep(sleep_duration)
async def main():
await asyncio.gather(example(), another_io_function())
if __name__ == '__main__':
asyncio.run(main())
Metadata
Release files for aogn 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aogn-0.1.3.tar.gz | 15.9 kB | Without provenance | Details for aogn-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aogn-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for aogn-0.1.3-py3-none-any.whl |
Total release size: 32.2 kB
Release files / aogn-0.1.3.tar.gz
| Download URL | aogn-0.1.3.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
935f535882e50685dd2df5da3da1e82880d16dc7c3c984298f2a66ca4ca2b548
|
|
BLAKE2b-256 checksum How to use checksums |
219f601198db75700a2b6816b6fa2687a61ee7c944d77fc5967073ac181728b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|
Release files / aogn-0.1.3-py3-none-any.whl
| Download URL | aogn-0.1.3-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62b2066bdee63ec571320272541b64f4d145a329905a614df0b762d17c738593
|
|
BLAKE2b-256 checksum How to use checksums |
b9ab59ff7f51bda5a6e86897039484d92933c5c3c4ae848497902531c32150cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|
Security for aogn 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.