Skip to main content

Tests PyPI version

ClAranet4

Ultra-minimal (i.e. incomplete) Python & CLI client for collecting current readings from Aranet4 Bluetooth sensors. This client uses Bleak and should work across platforms, and has been tested on Intel and ARM64 Macs. An xbar plugin for displaying measurements in the MacOS menu bar is included.

screenshot

Install

# Using uv (recommended) - installs in isolated environment
uv tool install claranet4

# Using pip
pip install claranet4  # Python >= 3.10, setuptools >= 64

# Development with uv (recommended)
git clone https://github.com/bede/claranet4.git
cd claranet4
uv sync --group dev  # Installs all dependencies including dev tools

# Development with pip (alternative)
git clone https://github.com/bede/claranet4.git
pip install --editable ./claranet4
pip install pytest build black pre-commit

Alternatively, use the static binary built from the latest release

CLI usage

If installed with uv tool install or pip install, use the command directly:

% claranet4 --help
usage: claranet4 [-h] [--version] {scan,discover,read} ...

positional arguments:
  {scan,discover,read}
    scan                Show nearby Bluetooth devices
    discover            Discover nearby Aranet4 devices
    read                Request latest measurements from a nearby Aranet4 device

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

For development installations (using uv sync), prefix commands with uv run:

uv run claranet4 --help
uv run pytest  # Run tests

Enumerate nearby Aranet4 devices

% claranet4 discover
INFO: Found 9 device(s)
INFO: Found 1 Aranet4 device(s)
[
    {
        "address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
        "name": "Aranet4 1D6BA",
        "rssi": -71
    }
]

Request measurements from an Aranet4 by address. If the device is unpaired, a prompt should appear for the pairing code.

% claranet4 read 390F544C-F0FF-F8BE-3A3A-BB1219AA2145
INFO: Selected Aranet4 1D6BA (-74dBm)
{
    "name": "Aranet4 1D6BA",
    "address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
    "rssi": -74,
    "co2": 946,
    "temperature": 17.6,
    "pressure": 1002.1,
    "humidity": 73.4
}

Executing claranet4 read without specifying an address will request measurements from the Aranet4 with the highest received signal strength (RSSI)

% claranet4 read
INFO: Found 9 device(s)
INFO: Found 1 Aranet4 device(s)
INFO: Selected Aranet4 1D6BA (-74dBm)
{
    "name": "Aranet4 1D6BA",
    "address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
    "rssi": -74,
    "co2": 946,
    "temperature": 17.6,
    "pressure": 1002.1,
    "humidity": 73.4
}

API usage

>>> from claranet4.lib import discover_ara4s, read
>>> discover_ara4s()
INFO: Found 28 device(s)
INFO: Found 1 Aranet4 device(s)
[Device(address='390F544C-F0FF-F8BE-3A3A-BB1219AA2145', name='Aranet4 1D6BA', rssi=-70)]
>>> read("390F544C-F0FF-F8BE-3A3A-BB1219AA2145").__dict__
INFO: Selected Aranet4 1D6BA (-74dBm)
{'name': 'Aranet4 1D6BA', 'address': '390F544C-F0FF-F8BE-3A3A-BB1219AA2145', 'rssi': -74, 'co2': 715, 'temperature': 20.4, 'pressure': 991.4, 'humidity': 63.4}

MacOS menu bar usage

  1. Install xbar (https://github.com/matryer/xbar).
  2. Download the MacOS executable for the latest release of Claranet4 https://github.com/bede/claranet4/releases).
  3. Download the xbar plugin claranet4.2m.sh from the xbar directory of this repository. Change the path at the bottom of this file to point to wherever your executable is stored.
  4. Open xbar, and open your plugins folder. Put claranet4.2m.sh inside it.
  5. Open System Preferences -> Security and Privacy and grant xbar permissions for Bluetooth, Automation and Developer Tools.

Development & Publishing

# Run tests
uv run pytest

# Format code
uv run black src/ tests/

# Build and publish to PyPI
uv build
uv publish

# Create release (update version in src/claranet4/__init__.py first)
git tag 0.5.0 && git push origin main && git push origin 0.5.0

Metadata

Release files for claranet4 0.4.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 claranet4 0.4.2
File Size Uploaded
claranet4-0.4.2.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claranet4 0.4.2
File Interpreter ABI Platform
claranet4-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / claranet4-0.4.2.tar.gz

Download URL claranet4-0.4.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
51293b81e778d624fb4cbd6f7d9ddcfe106c61ed619538d9d196203511fd7565
BLAKE2b-256 checksum
How to use checksums
2ad337b1af70db6f8c6e1b5fe8a8b788d385166956585abe54286e95ff113738
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / claranet4-0.4.2-py3-none-any.whl

Download URL claranet4-0.4.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9afc253b1efbdb5d3c7ac720a5a4b6bc554354359b92ac99e11af31c73c06b01
BLAKE2b-256 checksum
How to use checksums
898c866b8c0128eaa5d446216ed41fd1351f0582c777e8881d0ddf98544d4d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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