bleak


Namebleak JSON
Version 0.22.3 PyPI version JSON
download
home_pagehttps://github.com/hbldh/bleak
SummaryBluetooth Low Energy platform Agnostic Klient
upload_time2024-10-05 21:21:00
maintainerNone
docs_urlNone
authorHenrik Blidh
requires_python<3.14,>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====
bleak
=====

.. image:: https://raw.githubusercontent.com/hbldh/bleak/master/Bleak_logo2.png
    :target: https://github.com/hbldh/bleak
    :alt: Bleak Logo

.. image:: https://github.com/hbldh/bleak/workflows/Build%20and%20Test/badge.svg
    :target: https://github.com/hbldh/bleak/actions?query=workflow%3A%22Build+and+Test%22
    :alt: Build and Test

.. image:: https://img.shields.io/pypi/v/bleak.svg
    :target: https://pypi.python.org/pypi/bleak

.. image:: https://img.shields.io/pypi/dm/bleak.svg
    :target: https://pypi.python.org/pypi/bleak
    :alt: PyPI - Downloads

.. image:: https://readthedocs.org/projects/bleak/badge/?version=latest
    :target: https://bleak.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black

Bleak is an acronym for Bluetooth Low Energy platform Agnostic Klient.

* Free software: MIT license
* Documentation: https://bleak.readthedocs.io.

Bleak is a GATT client software, capable of connecting to BLE devices
acting as GATT servers. It is designed to provide a asynchronous,
cross-platform Python API to connect and communicate with e.g. sensors.

Installation
------------

.. code-block:: bash

    $ pip install bleak

Features
--------

* Supports Windows 10, version 16299 (Fall Creators Update) or greater
* Supports Linux distributions with BlueZ >= 5.43
* OS X/macOS support via Core Bluetooth API, from at least OS X version 10.11
* Android backend compatible with python-for-android

Bleak supports reading, writing and getting notifications from
GATT servers, as well as a function for discovering BLE devices.

Usage
-----

To discover Bluetooth devices that can be connected to:

.. code-block:: python

    import asyncio
    from bleak import BleakScanner

    async def main():
        devices = await BleakScanner.discover()
        for d in devices:
            print(d)

    asyncio.run(main())


Connect to a Bluetooth device and read its model number:

.. code-block:: python

    import asyncio
    from bleak import BleakClient

    address = "24:71:89:cc:09:05"
    MODEL_NBR_UUID = "2A24"

    async def main(address):
        async with BleakClient(address) as client:
            model_number = await client.read_gatt_char(MODEL_NBR_UUID)
            print("Model Number: {0}".format("".join(map(chr, model_number))))

    asyncio.run(main(address))

DO NOT NAME YOUR SCRIPT ``bleak.py``! It will cause a circular import error.

See examples folder for more code, for instance example code for connecting to a
`TI SensorTag CC2650 <http://www.ti.com/ww/en/wireless_connectivity/sensortag/>`_


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hbldh/bleak",
    "name": "bleak",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Henrik Blidh",
    "author_email": "henrik.blidh@nedomkull.com",
    "download_url": "https://files.pythonhosted.org/packages/fb/96/15750b50c0018338e2cce30de939130971ebfdf4f9d6d56c960f5657daad/bleak-0.22.3.tar.gz",
    "platform": null,
    "description": "=====\nbleak\n=====\n\n.. image:: https://raw.githubusercontent.com/hbldh/bleak/master/Bleak_logo2.png\n    :target: https://github.com/hbldh/bleak\n    :alt: Bleak Logo\n\n.. image:: https://github.com/hbldh/bleak/workflows/Build%20and%20Test/badge.svg\n    :target: https://github.com/hbldh/bleak/actions?query=workflow%3A%22Build+and+Test%22\n    :alt: Build and Test\n\n.. image:: https://img.shields.io/pypi/v/bleak.svg\n    :target: https://pypi.python.org/pypi/bleak\n\n.. image:: https://img.shields.io/pypi/dm/bleak.svg\n    :target: https://pypi.python.org/pypi/bleak\n    :alt: PyPI - Downloads\n\n.. image:: https://readthedocs.org/projects/bleak/badge/?version=latest\n    :target: https://bleak.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\nBleak is an acronym for Bluetooth Low Energy platform Agnostic Klient.\n\n* Free software: MIT license\n* Documentation: https://bleak.readthedocs.io.\n\nBleak is a GATT client software, capable of connecting to BLE devices\nacting as GATT servers. It is designed to provide a asynchronous,\ncross-platform Python API to connect and communicate with e.g. sensors.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    $ pip install bleak\n\nFeatures\n--------\n\n* Supports Windows 10, version 16299 (Fall Creators Update) or greater\n* Supports Linux distributions with BlueZ >= 5.43\n* OS X/macOS support via Core Bluetooth API, from at least OS X version 10.11\n* Android backend compatible with python-for-android\n\nBleak supports reading, writing and getting notifications from\nGATT servers, as well as a function for discovering BLE devices.\n\nUsage\n-----\n\nTo discover Bluetooth devices that can be connected to:\n\n.. code-block:: python\n\n    import asyncio\n    from bleak import BleakScanner\n\n    async def main():\n        devices = await BleakScanner.discover()\n        for d in devices:\n            print(d)\n\n    asyncio.run(main())\n\n\nConnect to a Bluetooth device and read its model number:\n\n.. code-block:: python\n\n    import asyncio\n    from bleak import BleakClient\n\n    address = \"24:71:89:cc:09:05\"\n    MODEL_NBR_UUID = \"2A24\"\n\n    async def main(address):\n        async with BleakClient(address) as client:\n            model_number = await client.read_gatt_char(MODEL_NBR_UUID)\n            print(\"Model Number: {0}\".format(\"\".join(map(chr, model_number))))\n\n    asyncio.run(main(address))\n\nDO NOT NAME YOUR SCRIPT ``bleak.py``! It will cause a circular import error.\n\nSee examples folder for more code, for instance example code for connecting to a\n`TI SensorTag CC2650 <http://www.ti.com/ww/en/wireless_connectivity/sensortag/>`_\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Bluetooth Low Energy platform Agnostic Klient",
    "version": "0.22.3",
    "project_urls": {
        "Changelog": "https://github.com/hbldh/bleak/blob/develop/CHANGELOG.rst",
        "Documentation": "https://bleak.readthedocs.io",
        "Homepage": "https://github.com/hbldh/bleak",
        "Issues": "https://github.com/hbldh/bleak/issues",
        "Support": "https://github.com/hbldh/bleak/discussions"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ace3adf9e742bb22e4a4b3435f24111cb46a1d12731ba655ee00bb5ab0308cc",
                "md5": "9d75d766d469b0a3c4548c459c7bc3f5",
                "sha256": "1e62a9f5e0c184826e6c906e341d8aca53793e4596eeaf4e0b191e7aca5c461c"
            },
            "downloads": -1,
            "filename": "bleak-0.22.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9d75d766d469b0a3c4548c459c7bc3f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.8",
            "size": 142719,
            "upload_time": "2024-10-05T21:20:58",
            "upload_time_iso_8601": "2024-10-05T21:20:58.547140Z",
            "url": "https://files.pythonhosted.org/packages/0a/ce/3adf9e742bb22e4a4b3435f24111cb46a1d12731ba655ee00bb5ab0308cc/bleak-0.22.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb9615750b50c0018338e2cce30de939130971ebfdf4f9d6d56c960f5657daad",
                "md5": "261eb442ba16707ed00a21265cd337fc",
                "sha256": "3149c3c19657e457727aa53d9d6aeb89658495822cd240afd8aeca4dd09c045c"
            },
            "downloads": -1,
            "filename": "bleak-0.22.3.tar.gz",
            "has_sig": false,
            "md5_digest": "261eb442ba16707ed00a21265cd337fc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.8",
            "size": 122339,
            "upload_time": "2024-10-05T21:21:00",
            "upload_time_iso_8601": "2024-10-05T21:21:00.661796Z",
            "url": "https://files.pythonhosted.org/packages/fb/96/15750b50c0018338e2cce30de939130971ebfdf4f9d6d56c960f5657daad/bleak-0.22.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 21:21:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hbldh",
    "github_project": "bleak",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bleak"
}
        
Elapsed time: 0.47972s