Skip to main content

ABle

Imports: isort Code style: black Type checking: mypy

Able stands for Allthenticate's BLE Peripheral Library. It serves the purpose of enabling the abstraction of using a BLE Peripheral on Ubuntu, MacOs and Windows based systems without having to adapt your software to have platform specific support.

In Progress

Note that this project is still undergoing work by the development team, the main things we are working on are:

  • Cleaning up some bugs in the bluezdbus and macos backend
  • Making the gitlab/github repo public for contributions
  • Setup a slack for developers to reach out to us about issues or ideas
  • Make logging/use clearer and update our documentation (for example we require a fork of bluez) and moving things from this readme to our docs
  • Get our docs on read the docs
  • Some more surprises :)

How To's

Quick Start

To get started just run get_started.sh. This will install poetry and all of the project's dependencies, and drop you into the projects virtual environment.

bash get_started.sh

Whenever you pull new updates we recommend running a quick poetry install to get any updates. From there, please check out our examples to get started with the project!

Upgrading Poetry Installer

It may be the case that the current version of your Poetry package is outdated. Run scripts/check_poetry.sh to check if there is a newer version of the poetry installer.

bash scripts/check_poetry.sh

Documentation

Writing Docs

We follow the Sphinx docstring format for our docstrings, see the following site on the complete specification, but the general docstring will look like:

"""
[Summary]

:param [ParamName]: [ParamDescription], defaults to [DefaultParamVal]
:type [ParamName]: [ParamType](, optional)
...
:raises [ErrorType]: [ErrorDescription]
...
:return: [ReturnDescription]
:rtype: [ReturnType]
"""

Generating Docs

To generate the docs for local use you should just have to run the following inside of the poetry shell:

make html

Then open the html produced by Sphinx.

Auto-Generating Docs

If you want to have docs magically update as you are writing them, run the following command:

sphinx-autobuild source/ build/html/

Testing Able

How To Test?

Running tests are easy, you need to only do a few things as a developer. First track down the IP of the companion you plan to be using, we recommend a raspberry pi. Once you have that IP, export it as an environment variable as so:

export ABLE_CENTRAL_IP="<IP>"

Now, we can run the tests with the following command:

poetry install && poetry run pytest tests

Rigorous Testing

If you want to do more rigorous testing over a long period of time and check for flaky tests, you will have to modify the pyproject.toml. We already have the dependencies you need to run tests multiple times to detect flakiness, all you need to do is modify the following line:

addopts = "--flake-finder --flake-runs=1 --reruns 5 --reruns-delay 5"

Into:

addopts = "--flake-finder --flake-runs=10 --reruns 5 --reruns-delay 5"

This will run each test 10 times, you can even modify it to be greater should you choose. You can also modify the reruns and reruns-delay parameters to change how much time you should wait between failed tests, maybe to let things simmer and how many reruns you will accept.

Speedy Tests

Our dependencies include pytest-fast-first which will locally track which tests are quicker and will use AI and deep learning (a json dictionary of times) to track and run tests that go faster first! Neat!

Coming Soon To Testing

We are hoping to have unit tests coming soon for Able but right now are relying solely on hardware in the loop tests to get things off the ground. Eventually we will detect if you have a companion set and if not, we will only run the unit tests.

Support

If you have any questions on the use of this library feel free to reach out the head maintainer bernie@allthenticate.com or submit an issue on the repository.

Contributing

Contributing is not currently enabled but once the repository is licensed we will be opening the project up for public contributions.

Acknowledgements

This project was inspired by the great work done by the developer team for Bleak which is a fantastic platform agnostic bluetooth framework for a BLE client/central we would highly reccomend!

We also took notes from the work done by Kevin Car with his companion library Bless, who made a great server supplement to Bleak whose work saved us from countless hours from fighting dbus and pyobjc!

Release files for able 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for able 0.3.4
File Size Uploaded
able-0.3.4.tar.gz 42.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for able 0.3.4
File Interpreter ABI Platform
able-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 93.6 kB

Release files / able-0.3.4.tar.gz

Download URL able-0.3.4.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fed389fbbc563c3f70ffbdc38569bcaebdf71cf1f1b2e8f4914fe7fda30a13be
BLAKE2b-256 checksum
How to use checksums
21ec2b5c851d831a4b2610a62927bd56faa7b99b566120db0624fd6b91e00e80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Linux/5.13.0-44-generic

Release files / able-0.3.4-py3-none-any.whl

Download URL able-0.3.4-py3-none-any.whl
Size 50.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3db37c4200fdf5dbd83d7fbc5e83387a8724b5a9c0e011823757f52041060d4d
BLAKE2b-256 checksum
How to use checksums
05bf6e28a0b795315e1953f1da0e1116a9cd41f9e91530994f5da44b7fb0f842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Linux/5.13.0-44-generic

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page