Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

btpy-2.0.9.tar.gz (113.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

btpy-2.0.9-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for btpy-2.0.9.tar.gz
Algorithm Hash digest
SHA256 c7aa975aae597c005d1265922ee03520089fec6e87ab6d68c3a67790d7a05705
MD5 de61fd98db4f890e5fb49c2ae22874aa
BLAKE2b-256 56b3987bb765c86fb5ebbfb51f0631bbdff605f81d7d51eb83cd2f6f46739112

See more details on using hashes here.

Provenance

The following attestation bundles were made for btpy-2.0.9.tar.gz:

Publisher: publish.yml on nbdy/btpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for btpy-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6123bc742d938adfa2027f36ca138c7c72a085d13b4096fcc7f57ff9b4e2bec4
MD5 f7e32beb2e30554b1ca4ea662bf1e7e1
BLAKE2b-256 7837b836e276b766e917e2393536cadc9f5693b8e6828ae5c85e09e9a4e0bb89

See more details on using hashes here.

Provenance

The following attestation bundles were made for btpy-2.0.9-py3-none-any.whl:

Publisher: publish.yml on nbdy/btpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page