bluezero


Namebluezero JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/ukBaz/python-bluezero
SummaryPython library for Bluetooth Low Energy (BLE) on Linux
upload_time2023-08-06 16:22:28
maintainerBarry Byford
docs_urlNone
authorBarry Byford
requires_python
licenseMIT
keywords bluetooth ble development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============
python-bluezero
===============
.. image:: https://github.com/ukBaz/python-bluezero/workflows/bluezero-tests/badge.svg
    :target: https://github.com/ukBaz/python-bluezero/actions?query=workflow%3Abluezero-tests
    :alt: Build Status

.. image:: https://img.shields.io/pypi/v/bluezero.svg
   :target: https://pypi.python.org/pypi/bluezero/
   :alt: PyPI Version

.. image:: https://img.shields.io/pypi/l/bluezero.svg
   :target: https://github.com/ukBaz/python-bluezero/blob/master/LICENSE
   :alt: MIT License

.. image:: https://readthedocs.org/projects/bluezero/badge/
   :target: https://bluezero.readthedocs.io/en/latest/
   :alt: docs

A simple Python interface to BlueZ stack

Name and aim
============
The aim of this library is to provide an API to access to *Bluez* with *zero* boilerplate code.

Goal
====
To provide a simplified API to people that want to use Bluetooth functionality in their code.
The library will use calls to the BlueZ D-Bus API and use 'sensible' defaults to help with that simplification.
It aims to support the ability to create interesting STEM activities without needing to 
explain the BlueZ API or write an event loop.

In addition to the API, it will contain examples of how to connect to common Bluetooth Smart (BLE) objects 
around them (or at least easily accessible to them).
These examples will need to be written without the need to sign (or break) non-disclosure agreements.

Status
======
While we want this to be easy to use it does not mean it easy to create.
This library is still in the early stages so things might change and break. Apologies in advance!
We will try to make it as stable as possible. However much of the functionality that is in BlueZ is
still flagged as experimental.
The library assumes you are using a Linux release with BlueZ 5.50. For example Raspberry Pi OS Buster


Getting Started
===============
If you are here for the time, and especially if you are new to Bluetooth Low Energy, then
a tutorial might be a good place to start.
The following tutorial has been created based on the readily available hardware of
a Raspberry Pi and a micro:bit. More details available at:
https://ukbaz.github.io/howto/ubit_workshop.html

Examples
========
There are some other examples in the library if you are feeling adventurous

Adapter
-------

adapter_example.py
******************
This will check that it can find the Bluetooth adapter on the computer running the code.
It will print to screen various information and check it is powered before scanning for
nearby devices

GATT Client (Central role)
--------------------------

microbit_poll.py
****************
This example uses the micro:bit API that has been written in bluezero.
You will need a buzzer attached to pin 0 to get play_beep to work.

Beacon
------

eddystone_url_beacon.py
***********************
A Simple Eddystone URL beacon.
You can be read the URL being broadcast with any Physical Web application on your Phone

Scanner
-------

eddystone_scanner.py
********************

This example scans for beacons using the common beacon formats of Eddystone URL,
Eddystone UID, AltBeacon and iBeacon.

GATT Server (Peripheral role)
-----------------------------
You will need to have modified the dbus configuration
file to open the permissions for 'ukBaz.bluezero'. This is covered in the
System Setup section of the documentation

cpu_temperature.py
******************

This example transmits the temperature of the CPU over the single characteristic.
The method `get_cpu_temperature()`
function creates randomly generated temperature values.
Values are only updated when notification are switched on.

ble_uart.py
-----------

This example simulates a basic UART connection over two lines, TXD and RXD.

It is based on a proprietary UART service specification by Nordic Semiconductors.
Data sent to and from this service can be viewed using the nRF UART apps from Nordic
Semiconductors for Android and iOS.

It uses the Bluezero peripheral file (level 10) so should be easier than the previous CPU
Temperature example that was a level 100.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ukBaz/python-bluezero",
    "name": "bluezero",
    "maintainer": "Barry Byford",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "barry_byford@yahoo.co.uk",
    "keywords": "Bluetooth BLE development",
    "author": "Barry Byford",
    "author_email": "barry_byford@yahoo.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/67/e1/15fc417b9828d38aa8e09ba06df61d6889740fe45867510a781df9a8ba35/bluezero-0.8.0.tar.gz",
    "platform": null,
    "description": "===============\npython-bluezero\n===============\n.. image:: https://github.com/ukBaz/python-bluezero/workflows/bluezero-tests/badge.svg\n    :target: https://github.com/ukBaz/python-bluezero/actions?query=workflow%3Abluezero-tests\n    :alt: Build Status\n\n.. image:: https://img.shields.io/pypi/v/bluezero.svg\n   :target: https://pypi.python.org/pypi/bluezero/\n   :alt: PyPI Version\n\n.. image:: https://img.shields.io/pypi/l/bluezero.svg\n   :target: https://github.com/ukBaz/python-bluezero/blob/master/LICENSE\n   :alt: MIT License\n\n.. image:: https://readthedocs.org/projects/bluezero/badge/\n   :target: https://bluezero.readthedocs.io/en/latest/\n   :alt: docs\n\nA simple Python interface to BlueZ stack\n\nName and aim\n============\nThe aim of this library is to provide an API to access to *Bluez* with *zero* boilerplate code.\n\nGoal\n====\nTo provide a simplified API to people that want to use Bluetooth functionality in their code.\nThe library will use calls to the BlueZ D-Bus API and use 'sensible' defaults to help with that simplification.\nIt aims to support the ability to create interesting STEM activities without needing to \nexplain the BlueZ API or write an event loop.\n\nIn addition to the API, it will contain examples of how to connect to common Bluetooth Smart (BLE) objects \naround them (or at least easily accessible to them).\nThese examples will need to be written without the need to sign (or break) non-disclosure agreements.\n\nStatus\n======\nWhile we want this to be easy to use it does not mean it easy to create.\nThis library is still in the early stages so things might change and break. Apologies in advance!\nWe will try to make it as stable as possible. However much of the functionality that is in BlueZ is\nstill flagged as experimental.\nThe library assumes you are using a Linux release with BlueZ 5.50. For example Raspberry Pi OS Buster\n\n\nGetting Started\n===============\nIf you are here for the time, and especially if you are new to Bluetooth Low Energy, then\na tutorial might be a good place to start.\nThe following tutorial has been created based on the readily available hardware of\na Raspberry Pi and a micro:bit. More details available at:\nhttps://ukbaz.github.io/howto/ubit_workshop.html\n\nExamples\n========\nThere are some other examples in the library if you are feeling adventurous\n\nAdapter\n-------\n\nadapter_example.py\n******************\nThis will check that it can find the Bluetooth adapter on the computer running the code.\nIt will print to screen various information and check it is powered before scanning for\nnearby devices\n\nGATT Client (Central role)\n--------------------------\n\nmicrobit_poll.py\n****************\nThis example uses the micro:bit API that has been written in bluezero.\nYou will need a buzzer attached to pin 0 to get play_beep to work.\n\nBeacon\n------\n\neddystone_url_beacon.py\n***********************\nA Simple Eddystone URL beacon.\nYou can be read the URL being broadcast with any Physical Web application on your Phone\n\nScanner\n-------\n\neddystone_scanner.py\n********************\n\nThis example scans for beacons using the common beacon formats of Eddystone URL,\nEddystone UID, AltBeacon and iBeacon.\n\nGATT Server (Peripheral role)\n-----------------------------\nYou will need to have modified the dbus configuration\nfile to open the permissions for 'ukBaz.bluezero'. This is covered in the\nSystem Setup section of the documentation\n\ncpu_temperature.py\n******************\n\nThis example transmits the temperature of the CPU over the single characteristic.\nThe method `get_cpu_temperature()`\nfunction creates randomly generated temperature values.\nValues are only updated when notification are switched on.\n\nble_uart.py\n-----------\n\nThis example simulates a basic UART connection over two lines, TXD and RXD.\n\nIt is based on a proprietary UART service specification by Nordic Semiconductors.\nData sent to and from this service can be viewed using the nRF UART apps from Nordic\nSemiconductors for Android and iOS.\n\nIt uses the Bluezero peripheral file (level 10) so should be easier than the previous CPU\nTemperature example that was a level 100.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for Bluetooth Low Energy (BLE) on Linux",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/ukBaz/python-bluezero"
    },
    "split_keywords": [
        "bluetooth",
        "ble",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c12adaef59bc129bd2c53f7ca005d032dace560ab69e98d1258eee75f1e3c70f",
                "md5": "1615221eaec12d1303cf800b7db344f9",
                "sha256": "980885f7b6c271a771c72c2c8361a0e9a8371c8c7b794c095909f3716ce03498"
            },
            "downloads": -1,
            "filename": "bluezero-0.8.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1615221eaec12d1303cf800b7db344f9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 41533,
            "upload_time": "2023-08-06T16:22:27",
            "upload_time_iso_8601": "2023-08-06T16:22:27.669843Z",
            "url": "https://files.pythonhosted.org/packages/c1/2a/daef59bc129bd2c53f7ca005d032dace560ab69e98d1258eee75f1e3c70f/bluezero-0.8.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67e115fc417b9828d38aa8e09ba06df61d6889740fe45867510a781df9a8ba35",
                "md5": "5c256c89c3973cfd20f340f095525af2",
                "sha256": "9bd6706ff6b941c3bedd5b64e0447051120ae8eeac458fb65f56cc6730e1e598"
            },
            "downloads": -1,
            "filename": "bluezero-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5c256c89c3973cfd20f340f095525af2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 37832,
            "upload_time": "2023-08-06T16:22:28",
            "upload_time_iso_8601": "2023-08-06T16:22:28.856044Z",
            "url": "https://files.pythonhosted.org/packages/67/e1/15fc417b9828d38aa8e09ba06df61d6889740fe45867510a781df9a8ba35/bluezero-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-06 16:22:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ukBaz",
    "github_project": "python-bluezero",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bluezero"
}
        
Elapsed time: 0.13048s