Python Bluetooth libraries

Updated Nov 2026

Python Bluetooth libraries scan for nearby devices, connect to them, and read or write their data. A Bluetooth Low Energy client talks to a device through GATT services and characteristics. These libraries let IoT tools, home automation systems, and test rigs control sensors and wearables.

Popularity

Bleak has the most monthly downloads in this comparison, at 2.3M.

LibraryMonthly downloadsStarsLast releaseLicense
Bleak
2.4M
2.6KNov 2026MIT
habluetooth
1.3M
24Nov 2026Apache-2.0
Bleak Retry Connector
852.4K
28Sep 2026MIT
Bumble
169.1K
591Oct 2026Apache-2.0
SimplePyBLE
104.7K
1.2KNov 2026BUSL-1.1
aioblescan
89.9K
127Jan 2023MIT
bleak-esphome
65.5K
14Aug 2026MIT
Bless
33.5K
197Dec 2025MIT
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Connects to Bluetooth Low Energy devices as an asynchronous GATT client.

Downloads / mo
2.4M
Stars
2.6K
Last release
3.1.0
License
MIT

Strengths

  • Cleans up managed connections. An async context manager connects and disconnects the client.
  • Reads and subscribes to characteristics. Read values, write values, or receive GATT notifications.

Limitations

  • Classic RFCOMM needs another library. Bleak handles BLE GATT rather than classic RFCOMM sockets.
  • Address-based connections trigger discovery. Pass a discovered BLEDevice when connecting to multiple devices.

Quickstart

From usage.html
$ python3.11 -m pip install bleak==3.1.0
import asyncio
from bleak import BleakScanner

async def main():
    print(await BleakScanner.discover())

asyncio.run(main())

Bleak examples

From open-source projects on GitHub

Provides high-availability Bluetooth management.

Downloads / mo
1.3M
Stars
24
Last release
7.1.3
License
Apache-2.0

Quickstart

From manager.py
$ python3.11 -m pip install habluetooth==7.1.3 bleak==3.1.0
import asyncio
from habluetooth import BluetoothManager

async def main():
    manager = BluetoothManager()
    await manager.async_setup()
    try:
        print(await manager.async_get_bluetooth_adapters())
    finally:
        manager.async_stop()

asyncio.run(main())

habluetooth examples

From open-source projects on GitHub

Bleak Retry Connector

Retries Bleak client connections after transient failures.

Downloads / mo
852.4K
Stars
28
Last release
4.7.1
License
MIT

Quickstart

From usage.html
$ python3.11 -m pip install bleak-retry-connector==4.7.1 bleak==3.1.0
import asyncio, os
from bleak import BleakScanner
from bleak_retry_connector import establish_connection, BleakClientWithServiceCache

async def main():
    device = await BleakScanner.find_device_by_address(os.environ["BLE_ADDRESS"])
    if device is None:
        raise RuntimeError("Device not found")
    client = await establish_connection(BleakClientWithServiceCache, device, device.name or device.address)
    try:
        print(client.services)
    finally:
        await client.disconnect()

asyncio.run(main())

Bleak Retry Connector examples

From open-source projects on GitHub

Implements a Bluetooth stack for apps, emulation, and testing.

Downloads / mo
169.1K
Stars
591
Last release
0.0.236
License
Apache-2.0

Quickstart

From device.py
$ python3.11 -m pip install bumble==0.0.236
import asyncio, os
from bumble.device import Device
from bumble.hci import Address
from bumble.transport import open_transport

async def main():
    async with await open_transport(os.environ["BUMBLE_TRANSPORT"]) as transport:
        device = Device.with_hci("Bumble", Address("F0:F1:F2:F3:F4:F5"), transport.source, transport.sink)
        await device.power_on()
        await device.start_scanning()
        await asyncio.sleep(5)
        await device.stop_scanning()

asyncio.run(main())

Bumble examples

From open-source projects on GitHub

Binds the cross-platform SimpleBLE library for Windows, macOS, and Linux, with a license required for commercial use.

Downloads / mo
104.7K
Stars
1.2K
Last release
1.4.0
License
BUSL-1.1

Quickstart

From wrap_adapter.cpp
$ python3.11 -m pip install simplepyble==1.4.0
import simplepyble

adapters = simplepyble.Adapter.get_adapters()
if not adapters:
    raise RuntimeError("No Bluetooth adapter found")
adapter = adapters[0]
adapter.scan_for(1000)
print(adapter.scan_get_results())

SimplePyBLE examples

From open-source projects on GitHub

Scans for Bluetooth advertisements with asyncio.

Downloads / mo
89.9K
Stars
127
Last release
0.2.14
License
MIT

Quickstart

From README.md
$ python3.11 -m pip install aioblescan==0.2.14
python3.11 -m aioblescan -D 0

aioblescan examples

From open-source projects on GitHub

Provides the ESPHome backend for Bleak.

Downloads / mo
65.5K
Stars
14
Last release
4.1.0
License
MIT

Quickstart

From usage.html
$ python3.11 -m pip install bleak-esphome==4.1.0 bleak==3.1.0 habluetooth==7.1.3
import asyncio, os
from habluetooth import BluetoothManager
from bleak import BleakScanner
from bleak_esphome import APIConnectionManager

async def main():
    manager = BluetoothManager()
    await manager.async_setup()
    connection = APIConnectionManager({"address": os.environ["ESPHOME_HOST"], "noise_psk": os.getenv("ESPHOME_NOISE_PSK")})
    try:
        await connection.start()
        print(await BleakScanner.discover())
    finally:
        await connection.stop()
        manager.async_stop()

asyncio.run(main())

bleak-esphome examples

From open-source projects on GitHub

Creates a Bluetooth Low Energy GATT server with custom services and characteristics.

Downloads / mo
33.5K
Stars
197
Last release
0.3.0
License
MIT

Strengths

  • Serves custom BLE characteristics. Define services and characteristics for BLE clients to read or write.
  • Routes callbacks per characteristic. Override a characteristic callback before falling back to server-wide handling.

Limitations

  • Writes need explicit callbacks. Define a write callback to handle incoming values.
  • Windows needs another setup package. Install pysetupdi alongside Bless on Windows.

Quickstart

From server.py
$ python3.11 -m pip install bless==0.3.0
import asyncio
from bless import BlessServer, GATTCharacteristicProperties, GATTAttributePermissions

async def main():
    server = BlessServer(name="BLE example")
    service = "0000180f-0000-1000-8000-00805f9b34fb"
    characteristic = "00002a19-0000-1000-8000-00805f9b34fb"
    await server.add_new_service(service)
    await server.add_new_characteristic(service, characteristic, GATTCharacteristicProperties.read, bytearray([100]), GATTAttributePermissions.readable)
    server.read_request_func = lambda item, **kwargs: item.value
    await server.start()
    try:
        await asyncio.sleep(5)
    finally:
        await server.stop()

asyncio.run(main())

Bless examples

From open-source projects on GitHub

FAQ

Bleak suits cross-platform Bluetooth Low Energy clients with asyncio. Bless suits code that must act as a GATT server. Bumble suits emulation and testing with a full Bluetooth stack in Python.

Bleak is an asynchronous Bluetooth Low Energy client for Windows, macOS, and Linux. It scans for devices and reads, writes, and subscribes to GATT characteristics.

Bleak runs on Raspberry Pi OS through the BlueZ stack. Classic Bluetooth serial connections use the operating system's sockets instead.

For coding agents

Found your Bluetooth library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official