GATT Link BLE
Connect to BLE GATT devices. Start with raw data. Add structure only when you need it.
GATT Link BLE is a lightweight Python library for discovering, connecting to, and interacting with Bluetooth Low Energy devices. Use generic GATT services and characteristics directly, or add device-specific profiles and parsers when you need structured data. Unknown devices do not need predefined profiles; device-specific interpretation stays separate from the generic client.
Features
- Discover GATT services, characteristics, and their properties.
- Read and write raw characteristic values.
- Receive raw notifications and indications.
- Choose PUSH connections or POLL_AND_DISCONNECT reads.
- Reconnect after unexpected disconnects and restore eligible subscriptions.
- Add optional device profiles and parsers through public registration APIs.
- Inspect connection and characteristic diagnostics.
- Python
>=3.14.2,<3.16; built on Bleak.
Install
python -m pip install gatt-link-ble
Quick start
This example scans for a device, connects, lists its GATT services, and reads
the first characteristic that advertises the read property.
import asyncio
from bleak import BleakScanner
from gatt_link_ble import ConnectionMode, GattLinkClient
async def main() -> None:
address = input("BLE address: ")
device = await BleakScanner.find_device_by_address(address, timeout=10)
if device is None:
raise RuntimeError(f"No BLE device found at {address}")
client = GattLinkClient(device, mode=ConnectionMode.PUSH)
try:
await client.start()
snapshot = await client.discover()
for service in snapshot.services:
print(f"Service {service.uuid}")
for characteristic in service.characteristics:
print(f" {characteristic.uuid}: {sorted(characteristic.properties)}")
readable = next(
(
characteristic
for service in snapshot.services
for characteristic in service.characteristics
if "read" in characteristic.properties
),
None,
)
if readable is not None:
value = await client.read_characteristic(readable.uuid)
print(f"Raw value: {value.hex(' ')}")
finally:
await client.stop()
asyncio.run(main())
Unknown BLE devices
No predefined profile? No problem.
Discover services and characteristics, inspect their properties, read or write raw values, and subscribe to notifications without registering a profile or parser. Unknown payloads remain accessible; the library does not guess their meaning, units, or data types.
Profiles and parsers
Profiles describe a device identity and its expected service/characteristic
signature. Parsers interpret payloads for known characteristics. Register them
independently with register_gatt_profile and register_gatt_parser; neither
is required for generic GATT access.
Devices and validation
| Device | Status |
|---|---|
| Nordic Thingy:52 | Hardware-validated reference profile, with recorded-payload regression tests. |
| Other BLE devices | Generic GATT access (adapter/device dependent); no device-specific hardware validation. |
Development
- Live scanner lists nearby devices and can inspect raw readable values.
- Tests use mocked BLE clients; they do not require hardware.
- Issues and bug reports
Run the test suite with uv sync --locked --all-groups && uv run pytest.
Metadata
Release files for gatt-link-ble 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gatt_link_ble-0.7.1.tar.gz | 72.0 kB | With provenance | Details for gatt_link_ble-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gatt_link_ble-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for gatt_link_ble-0.7.1-py3-none-any.whl |
Total release size: 93.1 kB
Release files / gatt_link_ble-0.7.1.tar.gz
| Download URL | gatt_link_ble-0.7.1.tar.gz |
|---|---|
| Size | 72.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41a5d8202055bf45310f9e8d7eb9d87d4b69c2f23a0af5770b35627f5ef67e6b
|
|
BLAKE2b-256 checksum How to use checksums |
b8ba52132ead082314eaa36fcdaa74a6f65dfca67395cb4bcb0ab7605c31a9f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / gatt_link_ble-0.7.1-py3-none-any.whl
| Download URL | gatt_link_ble-0.7.1-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aea48a92bab3afacbed1f6a5187a77aa22aa241d65bdd5fac050c5894359784b
|
|
BLAKE2b-256 checksum How to use checksums |
aeaba2ed7ed403cb36772e1889ff5d203b575692d39e0a07b8e90bf0537aca86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for gatt-link-ble 0.7.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gatt_link_ble-0.7.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA 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.