Skip to content

mgm8/pyngham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 21, 2023
e9944da · Jan 21, 2023
Apr 18, 2022
Jan 20, 2023
Jan 21, 2023
Jan 20, 2023
Sep 12, 2022
Mar 21, 2022
Jan 20, 2023
Nov 20, 2022
Aug 20, 2021
Jan 21, 2023
Jan 19, 2023
Aug 22, 2021
Jan 19, 2023

Repository files navigation

PyNGHam

Overview

The PyNGHam library is a Python version of the original NGHam protocol library written in C by Jon Petter Skagmo (LA3JPA).

The original implementation and a further description of the protocol can be found here.

Dependencies

Installing

This library is available in the PyPI repository, and can be installed with the following command:

  • pip install pyngham

Or, directly from the source files:

  • python setup.py install

Documentation

The documentation page is available here. Instructions to build the documentation page are described below.

Contributing instructions are also available here.

Dependencies

Building the Documentation

The documentation pages can be built with Sphinx by running the following command inside the docs folder:

  • make html

Usage Example

The usage of the library is pretty straightforward, after the initialization, there are two methods: one to encode a list of bytes, and other to decode a packet. Below there is a basic usage example:

from pyngham import PyNGHam

pngh = PyNGHam()

data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

pkt = pngh.encode(data)

print("Encoded packet:", pkt)

pl, errors, errors_pos = pngh.decode(pkt)

print("Decoded data:", pl)
print("Number of errors:", errors)
print("Errors positions:", errors_pos)

More usage examples can be found in the documentation page.

License

This project is licensed under LGPLv3 license.