Skip to content

eclipse-uprotocol/up-rust-py

Repository files navigation

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.


Features

  • 🚀 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

Build & Install

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 zenoh

Quick Start

Before running the below examples, you need to follow above commands to build from source using uv.

Simple Publisher (Local Transport)

For in-process communication without network overhead:

uv run examples/simple_publish.py

uv run examples/simple_notify.py

Zenoh Publisher and Subscriber

For zenoh communication

uv run examples/simple_zenoh_publisher.py

uv run examples/simple_zenoh_subscriber.py

Development

To 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

Building Wheels

# Build release wheel
uv run maturin build --release

# Build and publish to PyPI
uv run maturin publish

Architecture

up-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.

Links

Acknowledgments

Built with:

About

Python bindings for the uProtocol Language Library for Rust

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors