This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A python module for the Open Glider Network. The submodule ‘ogn.gateway’ is an aprs client which could be invoked via a CLI or used by other python projects. The CLI allows to save all received beacons into a database with SQLAlchemy. The sqlite-backend is sufficient for simple testing, but some tasks (e.g. logbook generation) require a proper backend like postgresql. An external python project would instantiate ogn.gateway and register a custom callback, called each time a beacon is received.


Usage - python module

Implement your own gateway by using ogn.gateway with a custom callback function. Each time a beacon is received, this function gets called and lets you process the incoming data.


#!/usr/bin/env python3

from ogn.model import AircraftBeacon, ReceiverBeacon
from ogn.gateway.client import ognGateway

def process_beacon(beacon):
    if type(beacon) is AircraftBeacon:
        print('Received aircraft beacon from {}'.format(
    elif type(beacon) is ReceiverBeacon:
        print('Received receiver beacon from {}'.format(

if __name__ == '__main__':
    gateway = ognGateway(aprs_user='N0CALL')

    try:, autoreconnect=True)
    except KeyboardInterrupt:
        print('\nStop ogn gateway')


Usage - CLI

Installation and Setup

  1. Checkout the repository

    git clone
  2. Install python requirements

    pip install -r requirements.txt
  3. Install redis for asynchronous tasks (like takeoff/landing-detection)

    apt-get install redis-server
  4. Create database

    ./ db.init

Running the aprs client and task server

To schedule tasks like takeoff/landing-detection (logbook.compute), Celery with Redis is used. The following scripts run in the foreground and should be deamonized (eg. use supervisord).

  • Start the aprs client

  • Start a task server (make sure redis is up and running)

    celery -A ogn.collect worker -l info
  • Start the task scheduler (make sure a task server is up and running)

    celery -A ogn.collect beat -l info

To load a custom configuration, create a file (see config/ and set the environment variable OGN_CONFIG_MODULE accordingly.

export OGN_CONFIG_MODULE="myconfig"
./ - CLI options

usage: [<namespace>.]<command> [<args>]

positional arguments:
  command     the command to run

optional arguments:
  -h, --help  show this help message and exit

available commands:

    drop                   Drop all tables.
    import_ddb             Import registered devices from the DDB.
    import_file            Import registered devices from a local file.
    init                   Initialize the database.
    upgrade                Upgrade database to the latest version.

    run                    Run the aprs client.

    compute                Compute takeoffs and landings.
    show                   Show a logbook for <airport_name> located at given position.

    stats                  Show some stats on registered devices.

    hardware_stats         Show some statistics of receiver hardware.
    list_all               Show a list of all receivers.
    software_stats         Show some statistics of receiver software.

Only the command logbook.compute requires a running task server (celery) at the moment.

Available tasks

  • ogn.collect.database.import_ddb - Import registered devices from the ddb
  • ogn.collect.database.import_file - Import registered devices from a local file
  • ogn.collect.heatmap.update_beacon_receiver_distance_all - Calculate the distance between aircraft and receiver for the last aircraft beacons
  • ogn.collect.receiver.update_receivers - Populate/update receiver table (requires postgresql-backend)
  • ogn.collect.logbook.compute_takeoff_and_landing - Generate TakeoffLanding table (requires postgresql-backend)

If the task server is up and running, tasks could be started manually.

>>>from ogn.collect.database import import_ddb


Licensed under the AGPLv3.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ogn_python-0.2.1-py3-none-any.whl (27.6 kB) Copy SHA256 Checksum SHA256 py3 Wheel Feb 17, 2016
ogn-python-0.2.1.tar.gz (35.1 kB) Copy SHA256 Checksum SHA256 Source Feb 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting