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.
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 Distributions
Built Distributions
Hashes for sbp-3.4.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da263205507c81dcf324256e0b956a65849f004a71b7298d67d77cebb9f9fa13 |
|
MD5 | 6b205b2bb9a2b409a6ecefdecbe1b2d8 |
|
BLAKE2b-256 | f2d1a1c615eca87c71a481583bf11a8611e09e2df305913a3192984828c4c008 |
Hashes for sbp-3.4.6-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ffe00d417be3a903101c9f92a3b334effca7a27f5edad180f0515f5f5621672 |
|
MD5 | c895c8c0891aa8c5291f10d3fb3e6bc1 |
|
BLAKE2b-256 | 3bde6036a6985a63899513d77bf965b2e1704f4e0e39641656e8b4240d106eb1 |
Hashes for sbp-3.4.6-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db5fbfc4185d2ddf8abcf08c0e91ff92b747dfbdd2e11918f04f693f6b4463ac |
|
MD5 | 2e0cbcd70f90866e47bfa16efd4290bc |
|
BLAKE2b-256 | ae4d0f2b203ee26af52f790fa52ebebfbe3e8418a691a09b0430900803941738 |
Hashes for sbp-3.4.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 651be33a1c71fce9c5b21e2b7f0d2d5cce344bbf5b1d9e7b417af98f826d02ff |
|
MD5 | a6de7e10e45fc8e4d363c2fe58ad3ebb |
|
BLAKE2b-256 | 13b32d760269758ef7a9e133049e334d7b27555b6887c9b7b2b64d08b7c86c15 |
Hashes for sbp-3.4.6-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb77e947f2c8f460bcc7a4dbd0be654f127349fd76a8c4865b7b06d8a937310f |
|
MD5 | b0d7bfb0cec1fa77993054719dcd8cac |
|
BLAKE2b-256 | e7cd9588c234cf250d7ba43a34d8a13ab86b2a75625fd873e14b74c394c62e2d |
Hashes for sbp-3.4.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c5211ca00d4cc04591f7cc23f92689d11a4be53b17434f39d6efd3227cd0df7 |
|
MD5 | 9fc5f996b84fc7358debfc58682a0414 |
|
BLAKE2b-256 | 1f895337cf2a370cd5c0b7e01559ad8b07f4b41f10d22fdcb44f4b8d63d74fd7 |
Hashes for sbp-3.4.6-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b50616582909fa6930b91553e0e81f7c3745f8b58a9b2b088e136567a11ec141 |
|
MD5 | fb9647966636cc1ed7ab914f4373dfc5 |
|
BLAKE2b-256 | 58918b6458377016cd4692fcee975ab5704aad3580ebf18e91d99477eb4d5f06 |
Hashes for sbp-3.4.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d69d13bd7dc704f4b5e7ed39a0c6d11743930b53d8eb295bcd4f31c4cbe6288 |
|
MD5 | 6f79a1201d1f9a67137c507b2ac31023 |
|
BLAKE2b-256 | 631ff1dcafe8fa8af64737dc78b37cf7e8936233d26f80567c7a487720099f8b |
Hashes for sbp-3.4.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12edbefc607d5737a818145257a565b9218743eb71669302dbc6b38bbb7293f2 |
|
MD5 | 9928968cf040c73a0f71f873fe6daaaa |
|
BLAKE2b-256 | 61fd0d98cea26e661aa9e28d3e60a4c619ca2502fab197195300f20129120d8f |
Hashes for sbp-3.4.6-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146809056b487ea50547ec3cbe245ee30b4d1c0d059e965e0ef2946f145e85ca |
|
MD5 | 33942ddb8c2dff5304ce91157965f7cf |
|
BLAKE2b-256 | df98a01c854ec2b9708ca4b57b5141dcf44e88cc07e7a1e06d9f824761d558b6 |