bitalino-rs
Rust driver and Python bindings for BITalino biosignal acquisition devices. This project opens RFCOMM connections to pre-paired devices with a minimal libc-based stack, exposes a safe Rust API, and ships Python wheels for easy use in data pipelines.
Quick Links
- Docs: tleygue.github.io/bitalino_rs (published via GitHub Pages; sources in docs/)
- Python package:
bitalino_rs(built with maturin, published from tags) - Crate:
bitalino-rs(Rust library)
Features
- Connect to BITalino over Bluetooth without root privileges (expects device is pre-paired/trusted).
- High-level Rust API plus generated Python bindings via PyO3/maturin.
- Timing-aware reads with sequence numbers, CRC tracking, and batch timestamps.
- Minimal dependencies; Ubuntu support verified in CI.
Project Layout
src/– Rust library (Bluetooth, driver, Python bindings)bitalino_rs/– Python package stub for maturin buildsdocs/– User/developer docs (mkdocs).github/workflows/– CI, release, PyPI publish
Install
Python (from PyPI, when released)
uv pip install bitalino-rs
Python (from source)
Requirements: Rust (stable), Python 3.11+.
# in repo root
uv sync
Rust crate (from source)
cargo build --release
Usage
Rust
use std::time::Duration;
use bitalino_rs::{Bitalino, SamplingRate};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut dev = Bitalino::connect("7E:91:2B:C4:AF:08", "1234")?;
dev.start(SamplingRate::Hz1000 as u16, Some(vec![0, 1, 2]))?;
dev.wait_until_streaming(Duration::from_secs(2))?; // block until BT link is reliable
let frames = dev.read_frames(100)?;
println!("read {} frames", frames.len());
dev.stop()?;
Ok(())
}
Python
from bitalino_rs import Bitalino
dev = Bitalino.connect("7E:91:2B:C4:AF:08")
dev.start(rate=1000, channels=[0, 1, 2])
dev.wait_until_streaming(timeout=2.0) # block until BT link is reliable
batch = dev.read_timed(200)
print(batch.timestamp_us, batch.sequence_gaps)
dev.stop()
Development
- Rust toolchain:
rustup toolchain install stable(CI uses stable with rustfmt/clippy) - System deps (Linux):
sudo apt-get install -y pkg-config libdbus-1-dev libudev-dev - Lint/format:
pre-commit run --all-files - Commit style: Conventional Commits (checked in CI)
- Tests:
cargo test --all-features --all-targets
Logging
- Default level:
info. Override withBITALINO_LOG=debug(falls back toRUST_LOGif unset). - Rust binaries: call
bitalino_rs::init_rust_logging()once (idempotent). - Python: logging is wired on import; adjust from Python with
bitalino_rs.enable_rust_logs("debug")or clear caches withbitalino_rs.reset_log_cache()after reconfiguring Python logging.
License
Apache License 2.0. See LICENSE.
Metadata
Release files for bitalino-rs 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bitalino_rs-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details for bitalino_rs-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl |
Release files / bitalino_rs-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | bitalino_rs-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 434.9 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
77b17735b44df80dae00b4c6ee601633fb97778cb6bdd2562438cb338b9b6932
|
|
BLAKE2b-256 checksum How to use checksums |
b85e9c3ccdc70fe9b01c3a81dd4fd676bc4c803c65074a6fe9e0555fcd797217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logSecurity for bitalino-rs 0.3.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.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for bitalino_rs-0.3.2-cp39-abi3-manylinux_2_28_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logA 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.