This repository provides Python bindings for the Eclipse uProtocol Rust library. Built using PyO3, it allows developers to seamlessly integrate high-performance, low-overhead uProtocol communication into their Python applications.
- 🚀 High Performance: Rust-powered implementations with minimal Python overhead
- 🔒 Type Safe: Full type hints and stub files for excellent IDE support
- 📡 Complete uProtocol Support: Publishers, Notifiers, and Transport implementations
- 🐍 Pythonic API: Easy-to-use interfaces that feel natural in Python
- ⚡ Async Ready: Built on Tokio async runtime for efficient I/O operations
To build the up-rust-py, you need to install uv (python project manager) and rust toolchain. Follow this link to install uv and this link to install rust toolchain.
Build from source using uv
# Clone the repository
git clone https://github.com/eclipse-uprotocol/up-rust-py.git
cd up-rust-py
uv sync
uv run maturin build
# To build with zenoh
uv run maturin build --features zenohBefore running the below examples, you need to follow above commands to build from source using uv.
For in-process communication without network overhead:
uv run examples/simple_publish.py
uv run examples/simple_notify.pyFor zenoh communication
uv run examples/simple_zenoh_publisher.py
uv run examples/simple_zenoh_subscriber.pyTo build up-rust-py in development mode, you need to run the following commands.
# Clone the repository
git clone https://github.com/eclipse-uprotocol/up-rust-py.git
cd up-rust-py
# Build in development mode
uv run maturin develop --features all
# Run tests
uv run pytest# Build release wheel
uv run maturin build --release
# Build and publish to PyPI
uv run maturin publishup-rust-py bridges Python and Rust using PyO3:
- Rust Core: High-performance implementations from up-rust
- PyO3 Bindings: Zero-cost abstractions between Python and Rust
- Python API: Pythonic interfaces with full type hints
Each async operation maintains its own Tokio runtime for thread-safe execution across the Python/Rust boundary.
Built with:
- Eclipse uProtocol - The underlying protocol specification
- PyO3 - Rust bindings for Python
- Maturin - Build tool for Rust/Python projects