Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A Python library for working with various types of Bluetooth LE Beacons.

Project Description

A Python library for working with various types of Bluetooth LE Beacons.

Currently supported types are:

The BeaconTools library has two main components:

  • a parser to extract information from raw binary beacon advertisements
  • a scanner which scans for Bluetoth LE advertisements using bluez and can be configured to look only for specific beacons or packet types


If you only want to use the parser install the library using pip and you’re good to go:

pip install beacontools

If you want to perfom beacon scanning there are a few more requirement. First of all you need an OS with bluez (most Linux OS; Windows and macOS are also possible but untested, see the “Build Requirements” section of pybluez for more information).

# install libbluetooth headers and libpcap2
sudo apt-get install python-dev libbluetooth-dev libcap2-bin
# grant the python executable permission to access raw socket data
sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which python))
# install beacontools with scanning support
pip install beacontools[scan]


See the examples directory for more usage examples.


from beacontools import parse_packet

tlm_packet = b"\x02\x01\x06\x03\x03\xaa\xfe\x11\x16\xaa\xfe\x20\x00\x0b\x18\x13\x00\x00\x00" \
tlm_frame = parse_packet(tlm_packet)
print("Voltage: %d mV" % tlm_frame.voltage)
print("Temperature: %d °C" % tlm_frame.temperature)
print("Advertising count: %d" % tlm_frame.advertising_count)
print("Seconds since boot: %d" % tlm_frame.seconds_since_boot)


import time
from beacontools import BeaconScanner, EddystoneTLMFrame, EddystoneFilter

def callback(bt_addr, rssi, packet, additional_info):
    print("<%s, %d> %s %s" % (bt_addr, rssi, packet, additional_info))

# scan for all TLM frames of beacons in the namespace "12345678901234678901"
scanner = BeaconScanner(callback,

import time
from beacontools import BeaconScanner, IBeaconFilter

def callback(bt_addr, rssi, packet, additional_info):
    print("<%s, %d> %s %s" % (bt_addr, rssi, packet, additional_info))

# scan for all iBeacon advertisements from beacons with the specified uuid
scanner = BeaconScanner(callback,


  • 1.2.0
    • Added support for Cypress iBeacons which transmit temp and humidity embedded in the minor value (thanks to darkskiez)
    • Updated dependencies
  • 1.1.0
    • Added support for Eddystone EID frames (thanks to miek)
    • Updated dependencies
  • 1.0.1
    • Implemented a small tweak which reduces the CPU usage.
  • 1.0.0
    • Implemented iBeacon support
    • Added rssi to callback function.
  • 0.1.2
    • Initial release
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
beacontools-1.2.0-py2.py3-none-any.whl (15.7 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Nov 23, 2017
beacontools-1.2.0.tar.gz (13.0 kB) Copy SHA256 Checksum SHA256 Source Nov 23, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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