Bluetooth SIG Standards Library¶
A pure Python library for Bluetooth SIG standards interpretation
Welcome¶
The Bluetooth SIG Standards Library provides comprehensive GATT characteristic and service parsing with automatic UUID resolution. Built on the official Bluetooth SIG specifications, it offers a robust, standards-compliant architecture for Bluetooth device communication with type-safe data parsing and clean API design.
Key Features¶
✅ Standards-Based: Official Bluetooth SIG YAML registry with automatic UUID resolution
✅ Type-Safe: Characteristic classes provide compile-time type checking and IDE autocomplete
✅ Modern Python: msgspec-based design with Python 3.9+ compatibility
✅ Comprehensive: Support for 200+ GATT characteristics across multiple service categories
✅ Framework Agnostic: Works with any BLE connection library (bleak, simplepyble, etc.)
Quick Example¶
Device abstraction (recommended for backend abstraction):
# SKIP: Requires actual BLE device connection
from bluetooth_sig import BluetoothSIGTranslator, Device
from bluetooth_sig.gatt.characteristics import BatteryLevelCharacteristic
# Connection manager for your BLE backend
from examples.connection_managers.bleak_retry import (
BleakRetryClientManager,
)
async def main():
translator = BluetoothSIGTranslator()
device = Device(
BleakRetryClientManager("AA:BB:CC:DD:EE:FF"), translator
)
await device.connect()
battery = await device.read(BatteryLevelCharacteristic) # IDE knows: int
print(f"Battery: {battery}%")
await device.disconnect()
Type-safe parsing (direct characteristic access):
from bluetooth_sig.gatt.characteristics import BatteryLevelCharacteristic
battery = BatteryLevelCharacteristic()
level = battery.parse_value(bytearray([85])) # IDE infers int
print(f"Battery: {level}%") # Battery: 85%
Dynamic parsing (for scanning unknown devices):
from bluetooth_sig import BluetoothSIGTranslator
translator = BluetoothSIGTranslator()
result = translator.parse_characteristic("2A19", bytearray([85]))
print(f"Battery Level: {result}%") # Battery Level: 85%
Getting Started¶
Get up and running in minutes
Install via pip or from source
Real-world usage patterns
Detailed API documentation
Which Guide Should I Read?¶
I want to… |
Read this |
|---|---|
Get started quickly |
|
Choose the right API approach |
|
Integrate with bleak or other BLE libraries |
|
See real-world usage patterns |
|
Use async patterns |
|
Understand the library’s purpose |
Why Choose This Library?¶
Unlike other Bluetooth libraries that focus on device connectivity, this library specializes in standards interpretation. It bridges the gap between raw BLE data and meaningful application-level information.
Support¶
Issues: GitHub Issues
Source Code: GitHub Repository
Documentation: You’re here! 🎉
Test Coverage: Available in CI artifacts
License¶
This project is licensed under the MIT License - see the LICENSE file for details.