Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Rustuya

Crates.io Pypi.org Documentation License: MIT

Local-network control of Tuya-compatible devices, built in Rust with first-class Python bindings. Designed for fleets of hundreds to thousands of devices — a native Rust core handles the I/O while the Python facade releases the GIL on every blocking call, so threaded Python workers stay live.

Install

Rust

cargo add rustuya

Python

pip install rustuya

Quick start

Rust

use rustuya::sync::Device;

let dev = Device::new("DEVICE_ID", "LOCAL_KEY");
dev.set_value(1, true)?;                        // turn on DP 1
println!("{:?}", dev.status()?);                // read current DPS

for msg in dev.listener() {                     // real-time events
    println!("{:?}", msg);
}

Python

from rustuya import Device

dev = Device("DEVICE_ID", "LOCAL_KEY")
dev.set_value(1, True)                          # turn on DP 1
print(dev.status())                             # read current DPS

for msg in dev.listener():                      # real-time events
    print(msg)

Features

  • Local-only — talks directly to devices over LAN, no Tuya Cloud
  • Rust core + Python bindings (PyO3) — same engine for both
  • Built for fleet scale — per-device background tasks with automatic reconnection and exponential backoff
  • Full protocol coverage — Tuya 3.1 / 3.2 / 3.3 / 3.4 / 3.5 + device22

See the Guide for the full API reference, design philosophy, and architecture notes.

Credits

The Tuya protocol layer in rustuya is derived from the specifications and error codes documented in tinytuya:

License

MIT

Release files for rustuya 0.3.0rc8

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

Source distribution (sdist)

Source distribution for rustuya 0.3.0rc8
File Size Uploaded
rustuya-0.3.0rc8.tar.gz 95.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rustuya 0.3.0rc8
File
rustuya-0.3.0rc8-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
rustuya-0.3.0rc8-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 4.2 MB

Release files / rustuya-0.3.0rc8.tar.gz

Download URL rustuya-0.3.0rc8.tar.gz
Size 95.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7b338abdc31890406de02b0bd99bfc2050029e9479d4aa6e4db039e537e565b1
BLAKE2b-256 checksum
How to use checksums
d155525ea9bbd2c4a2098e376fab43e4f577af1e737e497bbc3dd8f6be189326
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 Jun 28, 2026.

Transparency log

Release files / rustuya-0.3.0rc8-cp38-abi3-win_amd64.whl

Download URL rustuya-0.3.0rc8-cp38-abi3-win_amd64.whl
Size 913.3 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a098a3b65ce6fdc32e51e4f3528aafed4c28d61e0dce854346bc6eef32138771
BLAKE2b-256 checksum
How to use checksums
b072f84fbb457e0e2370a087f8cc595fab97d94f8ddcd4e1157d4f7b9477878c
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 Jun 28, 2026.

Transparency log

Release files / rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c4c6627742248ae543f7e78d396bd3418f2ccac4d895608e02caf8ba5a713d02
BLAKE2b-256 checksum
How to use checksums
e31ae7e06bc04e4574569480be1a1c38e7a37fe93b8e4ad90884a830ee62584f
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 Jun 28, 2026.

Transparency log

Release files / rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rustuya-0.3.0rc8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.1 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2eacad71a27c2953aeef08775c644d6ba22a5f1c6b95647eba9d4fcd333f6fee
BLAKE2b-256 checksum
How to use checksums
b8d138f72460daa4b3719b622253cd52c4921118e65d3d267d6efc7a8c24127f
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 Jun 28, 2026.

Transparency log

Release files / rustuya-0.3.0rc8-cp38-abi3-macosx_11_0_arm64.whl

Download URL rustuya-0.3.0rc8-cp38-abi3-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
32577c067c6478969af5c46c65fbad77e23548cb2ad437b12b61449d49778db1
BLAKE2b-256 checksum
How to use checksums
0b2c46a57941ec98ebc7c5d18965c5f654c69b6d7df9765d3662ddc65f33740b
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 Jun 28, 2026.

Transparency log
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