Skip to main content

Bleak compatible backend for Pythonista iOS app

license pypi py-versions Made in Ukraine

Pytest Mypy Ruff

This module uses bleak backend API to implement a compatible solution for Pythonista iOS app. It uses Pythonista built-in _cb module, that is wrapper to iOS CoreBluetooth.

  • This backend refers to Pythonista.cb docs
  • This backend refers to existing macOS CoreBluetooth bleak backend was used as a reference
  • It also provides stub files for pythonista built-in modules as _cb and pythonista.cb, and fake _cb.py implementation for testing on unsupported platforms
  • Use Bleak docs to explore how to use Bleak

Table of Contents

Installation

pip install bleak-pythonista

Usage

Direct import

import asyncio
from bleak_pythonista import BleakScanner, BleakClient

async def main():
    devices = await BleakScanner.discover(
        service_uuids=["<some-service-uuid>"]  # optional
    )
    for d in devices:
        print(d)
        client = BleakClient(d)
        await client.connect()
        print(client.services)

asyncio.run(main())

With bleak itself

import asyncio
from bleak import BleakScanner, BleakClient
from bleak_pythonista import BleakScannerPythonistaCB, BleakClientPythonistaCB

async def main():
    devices = await BleakScanner.discover(
        service_uuids=["<some-service-uuid>"],  # optional
        backend=BleakScannerPythonistaCB,
    )
    for d in devices:
        print(d)
        client = BleakClient(d, backend=BleakClientPythonistaCB)
        await client.connect()
        print(client.services)

asyncio.run(main())

What's done?

  • CentralManagerDelegate (for now for scanning purpose only)
  • client.BleakClientPythonistaCB
  • scanner.BleakScannerPythonistaCB
  • _cb and pythonista.cb stubs
  • fake cb.py for testing with backend simulation on unsupported platforms

Metadata

Release files for bleak-pythonista 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bleak-pythonista 0.1.2
File Size Uploaded Provenance Actions
bleak_pythonista-0.1.2.tar.gz 24.1 kB Without provenance Details for bleak_pythonista-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bleak-pythonista 0.1.2
File Interpreter ABI Platform Actions
bleak_pythonista-0.1.2-py3-none-any.whl Python 3 none any Details for bleak_pythonista-0.1.2-py3-none-any.whl

Total release size: 48.5 kB

Release files / bleak_pythonista-0.1.2.tar.gz

Download URL bleak_pythonista-0.1.2.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
08f140a0e64ca6d23a7fb604c9e54d7e54245575f8ede93493e251298f3be1c1
BLAKE2b-256 checksum
How to use checksums
e1712f78f72a255474443f720114e39c0b5059aef86dcf8730b93e6a6cbc7c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.6

Release files / bleak_pythonista-0.1.2-py3-none-any.whl

Download URL bleak_pythonista-0.1.2-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03c1d86338b908b67d638b4c265b06eca918d4b17a5954c46312c6e82af8cb49
BLAKE2b-256 checksum
How to use checksums
eaa0031cc1101db3bb84b5452001cbfd3a77ae05b27635c17b4dd85474c8d6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.6

Security for bleak-pythonista 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page