Skip to main content

Python bindings for Swift Binary Protocol

Project description

Python client for Swift Binary Protocol (SBP).

Since v2.5 libsbp is compatible with Python 2.7, 3.5 to 3.9. For new projects, Python 3.7 or newer is recommended.

Setup

You must have python and pip installed.

Install dependencies only:

$ pip install -r requirements.txt

Install from source:

$ pip install ./python

Install package from PyPI (use sudo ... to install globally):

$ pip install sbp

Installing extras to enable JIT speed-ups

The sbp.jit package is a mostly source compatible alternative to the sbp package which includes natively compiled speed-ups, built with the Numba library.

These speed-ups are optionally enabled because they are only compatible with a subset of systems and hardware (typically Linux on x86_64/ARM, macOS on x86_64, and Windows on x86/x86_64).

To enable these speed-ups the package includes several “extras” that enable either the JIT (just-in-time) or AOT (ahead-of-time) compiled speed-ups.

The recommend route is to install the AOT “extra” to enable these speed-ups (use sudo ... to install globally):

$ pip install sbp[aot]

To enable JIT, which will compile the speed-ups when the sbp.jit package is imported, install the package from PyPI with the “JIT” extra enabled (this will pull in Numba, which will in turn require a Python LLVM package):

$ pip install sbp[jit]

Or locally from the repository:

$ pip install ./python[jit]

Setup using a virtual environment

Setup and activate the virtualenv:

$ virtualenv .env && source .env/bin/activate

Install py.test in the virtualenv:

$ pip install pytest-virtualenv

Install the pt.test coverage tools:

$ pip install pytest-cov

Finally, proceed to the standard setup instructions.

Usage Examples

Simple example

Receives SBP messages over a serial port, decodes MSG_BASELINE messages and prints them out. See simple.py .

Run this example with:

$ python -m sbp.client.examples.simple -p /path/to/serial/port

Sending SBP messages over UDP

Receives SBP messages over a serial port and sends all incoming messages to a UDP socket. See udp.py .

Run this example with:

$ python -m sbp.client.examples.udp -s /path/to/serial/port

Testing

To run the tests and check for coverage:

$  py.test -v --cov sbp tests/

To run the tests without suppressing stdout output:

$ py.test -v -s –cov sbp tests/

License

Copyright © 2015 Swift Navigation

Distributed under MIT.

Release history Release notifications | RSS feed

This version

3.4.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

sbp-3.4.6-py2.py3-none-any.whl (139.2 kB view hashes)

Uploaded Python 2 Python 3

sbp-3.4.6-cp38-cp38-win_amd64.whl (232.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

sbp-3.4.6-cp38-cp38-win32.whl (231.2 kB view hashes)

Uploaded CPython 3.8 Windows x86

sbp-3.4.6-cp38-cp38-manylinux1_x86_64.whl (259.8 kB view hashes)

Uploaded CPython 3.8

sbp-3.4.6-cp38-cp38-macosx_10_14_x86_64.whl (282.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

sbp-3.4.6-cp37-cp37m-win_amd64.whl (231.7 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

sbp-3.4.6-cp37-cp37m-win32.whl (230.9 kB view hashes)

Uploaded CPython 3.7m Windows x86

sbp-3.4.6-cp37-cp37m-manylinux1_x86_64.whl (259.6 kB view hashes)

Uploaded CPython 3.7m

sbp-3.4.6-cp37-cp37m-macosx_10_14_x86_64.whl (282.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

sbp-3.4.6-cp37-cp37m-linux_armv7l.whl (446.5 kB view hashes)

Uploaded CPython 3.7m

sbp-3.4.6-cp36-cp36m-win_amd64.whl (231.8 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

sbp-3.4.6-cp36-cp36m-win32.whl (230.9 kB view hashes)

Uploaded CPython 3.6m Windows x86

sbp-3.4.6-cp36-cp36m-manylinux1_x86_64.whl (259.6 kB view hashes)

Uploaded CPython 3.6m

sbp-3.4.6-cp36-cp36m-macosx_10_14_x86_64.whl (282.5 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

Supported by

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