Skip to main content
Build and Test https://img.shields.io/pypi/v/bleak.svg PyPI - Downloads Documentation Status https://img.shields.io/badge/code%20style-black-000000.svg

Bleak is an acronym for Bluetooth Low Energy platform Agnostic Klient.

Bleak is a GATT client software, capable of connecting to BLE devices acting as GATT servers. It is designed to provide a asynchronous, cross-platform Python API to connect and communicate with e.g. sensors.

Installation

$ pip install bleak

Features

  • Supports Windows 11, version 22000 and greater

  • Supports Linux distributions with BlueZ >= 5.55

  • OS X/macOS support via Core Bluetooth API, from at least OS X version 10.15

  • Android backend compatible with python-for-android

Bleak supports reading, writing and getting notifications from GATT servers, as well as a function for discovering BLE devices.

Usage

To discover Bluetooth devices that can be connected to:

import asyncio
from bleak import BleakScanner

async def main():
    devices = await BleakScanner.discover()
    for d in devices:
        print(d)

asyncio.run(main())

Connect to a Bluetooth device and read its model number:

import asyncio
from bleak import BleakClient

address = "24:71:89:cc:09:05"
MODEL_NBR_UUID = "2A24"

async def main(address):
    async with BleakClient(address) as client:
        model_number = await client.read_gatt_char(MODEL_NBR_UUID)
        print(f"Model Number: {model_number.decode()}")

asyncio.run(main(address))

DO NOT NAME YOUR SCRIPT bleak.py! It will cause a circular import error.

See examples folder for more code, for instance example code for connecting to a TI SensorTag CC2650

Metadata

Release files for bleak 3.0.2

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

Source distribution (sdist)

Source distribution for bleak 3.0.2
File Size Uploaded Provenance Actions
bleak-3.0.2.tar.gz 125.3 kB Without provenance Details for bleak-3.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 271.8 kB

Release files / bleak-3.0.2.tar.gz

Download URL bleak-3.0.2.tar.gz
Size 125.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c2229cb8238d5876b4bd05c74bf7a1aea1f88da39d2e51ac9dfd5cc319d5265f
BLAKE2b-256 checksum
How to use checksums
16df05a3f80ca8e3f7f5b0dba68a9e618147c909ccdba1468f07487dc8d72a9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / bleak-3.0.2-py3-none-any.whl

Download URL bleak-3.0.2-py3-none-any.whl
Size 146.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39092feb9e83f1df5ad2f88e837723c7211c982ce9e9cda6235104bc2ebe0d0d
BLAKE2b-256 checksum
How to use checksums
265405aceb9cd80073805b3ed8522e3196e8cb22f70e741873fa51406c31f4e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for bleak 3.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.0.2 This release

2 release files No provenance

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