bluepy3


Namebluepy3 JSON
Version 2.6.1 PyPI version JSON
download
home_pageNone
SummaryA Python3 module for interfacing with Bluetooth LE devices on Linux.
upload_time2024-04-27 19:20:21
maintainerNone
docs_urlNone
authorMausy5043
requires_python>=3.8
licenseNone
keywords ble bluetooth bluetooth low energy bluetooth smart raspberry pi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://img.shields.io/pypi/v/bluepy3.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/bluepy3)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/bluepy3?logo=python&logoColor=FFE873)](https://pypi.org/project/bluepy3)
[![PyPI downloads](https://img.shields.io/pypi/dm/bluepy3.svg)](https://pypistats.org/packages/bluepy3)
[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)

# bluepy3

This is a Python3 library to allow communication with Bluetooth Low Energy devices on Linux.

## Requirements

Please be aware that this is not a beginners tool. Some experience with Linux CLI, Python3 and BT/BLE is expected.

Development of this package is done in Python 3.11. The package is considered forwards compatible at least upto Python 3.12 and probably also beyond. Backwards compatibility is not guaranteed; if it works on Python 3.9 or before consider yourself lucky. [Python versions that are end-of-life](https://devguide.python.org/versions/) are not supported.

The package has been extensively tested on a Raspberry Pi 3 Model B+ (aarch64) with Debian GNU Linux 11 w/ Python 3.9.* AND with Debian GNU Linux 12 /w Python 3.11.*.

The code needs an executable `bluepy3-helper` which is compiled from C source automatically
when first used (see below).

The `bluepy3` package comes installed with lists of compatible UUIDs in `uuids.json`.
If, for whatever reason, you want to rebuild those lists, then the Python3 modules
`bs4`, `requests` and `lxml` need to be installed.
```(python3)
python3 -m pip install bs4 lxml requests
```
Then find where the bluepy3 package is installed and rebuild `uuids.json` thus:
```(bash)
cd some_path_name/site-packages/bluepy3/
make uuids.json
```

## Installation

To install the currently released version, on most Debian-based systems:
```(bash)
sudo apt-get install libglib2.0-dev libbluetooth-dev
python3 -m pip install --upgrade bluepy3
```
Then test the installation using:
```(bash)
sudo setcap cap_net_raw,cap_net_admin+ep $(find . -name bluepy3-helper)
blescan -n
sudo hcitool lescan
```
This should list the (compatible) Bluetooth devices in range.

Upon the first `import` of `bluepy3.btle` the required binary is compiled. This requires the download of the BlueZ source (20MB) to `/tmp` (don't worry this is done automatically). The default behaviour is to compile against the version of the BlueZ source that matches the version of the installed `bluetoothctl`. The user may override this by forcing compilation against any of the supported source trees by running `helpermaker --build <version>`.

It may be considered to have command-line tools from BlueZ available for debugging.

## Troubleshooting

Make sure the user is part of the `bluetooth` group.
Use `hciconfig` to confirm that the device actually exists. This should output something like:
```
hci0:    Type: Primary  Bus: UART
BD Address: B8:27:EB:90:4F:F5  ACL MTU: 1021:8  SCO MTU: 64:1
UP RUNNING
RX bytes:15332515 acl:452626 sco:0 events:333729 errors:0
TX bytes:7376962 acl:438075 sco:0 commands:72113 errors:0
```
Use `hciconfig [hci0] up` to activate the BT device if the above returns an error.

## Documentation

For documentation you are referred to [the documentation that comes with `bluepy`](http://ianharvey.github.io/bluepy-doc/). Be warned though that as development of `bluepy3` advances some of the documentation may be off a bit.

## Contributing

Your assistance to improve this package is greatly appreciated.
See [CONTRIBUTING](CONTRIBUTING.md) for details.

## License

See [LICENSE](LICENSE)

## Acknowledgements

This work builds on previous work by [Ian Harvey](https://github.com/IanHarvey/bluepy) and uses code
by the [BlueZ project](http://www.bluez.org/) (not a https site) and the more
up-to-date [BlueZ on GitHub](https://github.com/bluez/bluez)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bluepy3",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "BLE, Bluetooth, Bluetooth Low Energy, Bluetooth Smart, Raspberry Pi",
    "author": "Mausy5043",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/ad/8b/df3fdc63d03dcc3dcbd5277fc1bd6f2c03c2b128ff5e86181c89fb922015/bluepy3-2.6.1.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://img.shields.io/pypi/v/bluepy3.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/bluepy3)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/bluepy3?logo=python&logoColor=FFE873)](https://pypi.org/project/bluepy3)\n[![PyPI downloads](https://img.shields.io/pypi/dm/bluepy3.svg)](https://pypistats.org/packages/bluepy3)\n[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)\n\n# bluepy3\n\nThis is a Python3 library to allow communication with Bluetooth Low Energy devices on Linux.\n\n## Requirements\n\nPlease be aware that this is not a beginners tool. Some experience with Linux CLI, Python3 and BT/BLE is expected.\n\nDevelopment of this package is done in Python 3.11. The package is considered forwards compatible at least upto Python 3.12 and probably also beyond. Backwards compatibility is not guaranteed; if it works on Python 3.9 or before consider yourself lucky. [Python versions that are end-of-life](https://devguide.python.org/versions/) are not supported.\n\nThe package has been extensively tested on a Raspberry Pi 3 Model B+ (aarch64) with Debian GNU Linux 11 w/ Python 3.9.* AND with Debian GNU Linux 12 /w Python 3.11.*.\n\nThe code needs an executable `bluepy3-helper` which is compiled from C source automatically\nwhen first used (see below).\n\nThe `bluepy3` package comes installed with lists of compatible UUIDs in `uuids.json`.\nIf, for whatever reason, you want to rebuild those lists, then the Python3 modules\n`bs4`, `requests` and `lxml` need to be installed.\n```(python3)\npython3 -m pip install bs4 lxml requests\n```\nThen find where the bluepy3 package is installed and rebuild `uuids.json` thus:\n```(bash)\ncd some_path_name/site-packages/bluepy3/\nmake uuids.json\n```\n\n## Installation\n\nTo install the currently released version, on most Debian-based systems:\n```(bash)\nsudo apt-get install libglib2.0-dev libbluetooth-dev\npython3 -m pip install --upgrade bluepy3\n```\nThen test the installation using:\n```(bash)\nsudo setcap cap_net_raw,cap_net_admin+ep $(find . -name bluepy3-helper)\nblescan -n\nsudo hcitool lescan\n```\nThis should list the (compatible) Bluetooth devices in range.\n\nUpon the first `import` of `bluepy3.btle` the required binary is compiled. This requires the download of the BlueZ source (20MB) to `/tmp` (don't worry this is done automatically). The default behaviour is to compile against the version of the BlueZ source that matches the version of the installed `bluetoothctl`. The user may override this by forcing compilation against any of the supported source trees by running `helpermaker --build <version>`.\n\nIt may be considered to have command-line tools from BlueZ available for debugging.\n\n## Troubleshooting\n\nMake sure the user is part of the `bluetooth` group.\nUse `hciconfig` to confirm that the device actually exists. This should output something like:\n```\nhci0:    Type: Primary  Bus: UART\nBD Address: B8:27:EB:90:4F:F5  ACL MTU: 1021:8  SCO MTU: 64:1\nUP RUNNING\nRX bytes:15332515 acl:452626 sco:0 events:333729 errors:0\nTX bytes:7376962 acl:438075 sco:0 commands:72113 errors:0\n```\nUse `hciconfig [hci0] up` to activate the BT device if the above returns an error.\n\n## Documentation\n\nFor documentation you are referred to [the documentation that comes with `bluepy`](http://ianharvey.github.io/bluepy-doc/). Be warned though that as development of `bluepy3` advances some of the documentation may be off a bit.\n\n## Contributing\n\nYour assistance to improve this package is greatly appreciated.\nSee [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## License\n\nSee [LICENSE](LICENSE)\n\n## Acknowledgements\n\nThis work builds on previous work by [Ian Harvey](https://github.com/IanHarvey/bluepy) and uses code\nby the [BlueZ project](http://www.bluez.org/) (not a https site) and the more\nup-to-date [BlueZ on GitHub](https://github.com/bluez/bluez)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python3 module for interfacing with Bluetooth LE devices on Linux.",
    "version": "2.6.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Mausy5043/bluepy3/issues",
        "Homepage": "https://github.com/Mausy5043/bluepy3"
    },
    "split_keywords": [
        "ble",
        " bluetooth",
        " bluetooth low energy",
        " bluetooth smart",
        " raspberry pi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad8bdf3fdc63d03dcc3dcbd5277fc1bd6f2c03c2b128ff5e86181c89fb922015",
                "md5": "b04ef3b3c8c3e5b4f97086c71187d98b",
                "sha256": "3bd8d80dd8222d00b010cadb6c0283acf3c2ba85b97a8203353c4f17f35ef0ae"
            },
            "downloads": -1,
            "filename": "bluepy3-2.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b04ef3b3c8c3e5b4f97086c71187d98b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 41712,
            "upload_time": "2024-04-27T19:20:21",
            "upload_time_iso_8601": "2024-04-27T19:20:21.873360Z",
            "url": "https://files.pythonhosted.org/packages/ad/8b/df3fdc63d03dcc3dcbd5277fc1bd6f2c03c2b128ff5e86181c89fb922015/bluepy3-2.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 19:20:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Mausy5043",
    "github_project": "bluepy3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "bluepy3"
}
        
Elapsed time: 0.24305s