No project description provided
Project description
btpy
A comprehensive Python library for Bluetooth communication, providing unified interfaces for Bluetooth Low Energy (BLE), Classic Bluetooth, and Beacon devices.
Features
- Bluetooth Low Energy (BLE): Scan and interact with BLE devices using bleak
- Beacon Support: Detect and parse beacon advertisements using beacontools
- Classic Bluetooth: Work with classic Bluetooth devices via bumble
- Simple API: Easy-to-use interface for common Bluetooth operations
- Cross-platform: Works on Linux, macOS, and Windows (where supported by underlying libraries)
Requirements
- Python >= 3.10
- Compatible operating system (Linux, macOS, or Windows)
Installation
Using pip
pip3 install btpy
Using uv
uv pip install btpy
Or add to your project:
uv add btpy
Usage
The library provides three main device classes for different Bluetooth types:
Scanning for BLE Devices
from btpy import LEDevice
# Scan for BLE devices for 4 seconds
le_results = LEDevice.scan(4)
Scanning for Beacons
from btpy import Beacon
# Scan for beacons for 5 seconds
beacon_results = Beacon.scan(5)
Scanning for Classic Bluetooth Devices
from btpy import ClassicDevice
# Scan for classic Bluetooth devices for 6 seconds
classic_results = ClassicDevice.scan(6)
Combined Example
from btpy import LEDevice, Beacon, ClassicDevice
# Perform all scans
le_results = LEDevice.scan(4)
beacon_results = Beacon.scan(5)
classic_results = ClassicDevice.scan(6)
print(f"Found {len(le_results)} BLE devices")
print(f"Found {len(beacon_results)} beacons")
print(f"Found {len(classic_results)} classic devices")
Documentation
For more detailed documentation, please visit the Wiki.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests on the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
TODO
- Add comprehensive tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file btpy-2.0.9.tar.gz.
File metadata
- Download URL: btpy-2.0.9.tar.gz
- Upload date:
- Size: 113.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7aa975aae597c005d1265922ee03520089fec6e87ab6d68c3a67790d7a05705
|
|
| MD5 |
de61fd98db4f890e5fb49c2ae22874aa
|
|
| BLAKE2b-256 |
56b3987bb765c86fb5ebbfb51f0631bbdff605f81d7d51eb83cd2f6f46739112
|
Provenance
The following attestation bundles were made for btpy-2.0.9.tar.gz:
Publisher:
publish.yml on nbdy/btpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
btpy-2.0.9.tar.gz -
Subject digest:
c7aa975aae597c005d1265922ee03520089fec6e87ab6d68c3a67790d7a05705 - Sigstore transparency entry: 628751718
- Sigstore integration time:
-
Permalink:
nbdy/btpy@12f43bf20fc6b66fa315b9b4959fa15cbe18e22e -
Branch / Tag:
refs/tags/v2.0.9 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@12f43bf20fc6b66fa315b9b4959fa15cbe18e22e -
Trigger Event:
push
-
Statement type:
File details
Details for the file btpy-2.0.9-py3-none-any.whl.
File metadata
- Download URL: btpy-2.0.9-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6123bc742d938adfa2027f36ca138c7c72a085d13b4096fcc7f57ff9b4e2bec4
|
|
| MD5 |
f7e32beb2e30554b1ca4ea662bf1e7e1
|
|
| BLAKE2b-256 |
7837b836e276b766e917e2393536cadc9f5693b8e6828ae5c85e09e9a4e0bb89
|
Provenance
The following attestation bundles were made for btpy-2.0.9-py3-none-any.whl:
Publisher:
publish.yml on nbdy/btpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
btpy-2.0.9-py3-none-any.whl -
Subject digest:
6123bc742d938adfa2027f36ca138c7c72a085d13b4096fcc7f57ff9b4e2bec4 - Sigstore transparency entry: 628751719
- Sigstore integration time:
-
Permalink:
nbdy/btpy@12f43bf20fc6b66fa315b9b4959fa15cbe18e22e -
Branch / Tag:
refs/tags/v2.0.9 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@12f43bf20fc6b66fa315b9b4959fa15cbe18e22e -
Trigger Event:
push
-
Statement type: