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.0rc9

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.0rc9
File Size Uploaded
rustuya-0.3.0rc9.tar.gz 95.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rustuya 0.3.0rc9
File
rustuya-0.3.0rc9-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
rustuya-0.3.0rc9-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.0rc9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
rustuya-0.3.0rc9-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.0rc9.tar.gz

Download URL rustuya-0.3.0rc9.tar.gz
Size 95.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5ef0675d5b7631bd46a4c83eeab589dcb1239d32a966ae9fff3c187b23fce540
BLAKE2b-256 checksum
How to use checksums
34c0343fa7d7f1a40e9a5d478cfe1e54a0dffdd2d0505a58a53ff2efb7c9b184
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.0rc9-cp38-abi3-win_amd64.whl

Download URL rustuya-0.3.0rc9-cp38-abi3-win_amd64.whl
Size 912.4 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
82bd13816fb47623409745c084c1fe03373c64992e946580c16c946ecf4236a2
BLAKE2b-256 checksum
How to use checksums
859faee57509873a0e3978e71204c48f55712c641525293f8ab9ec305f8d549f
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.0rc9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rustuya-0.3.0rc9-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
a435cfa14edb2ef109e383c496e09a88ba9ed7952efbe8117bf36f75ef45e5a8
BLAKE2b-256 checksum
How to use checksums
d0bf8eb783cc1dd5024e6cf4c7ffc8fedfc2ba55489e5738cf7fe0eb0aa50a54
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.0rc9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rustuya-0.3.0rc9-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
d5c752e121a61dec1323e682a792864284ab1ce5c3f20f59baaae1ba72acb98c
BLAKE2b-256 checksum
How to use checksums
ded45af48aa0d7a6cd83c273974fb3eacce276dd720b13e367b768a9f883bc33
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.0rc9-cp38-abi3-macosx_11_0_arm64.whl

Download URL rustuya-0.3.0rc9-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
3300991953a324f61afb2c7dfb032cf6e13addf3b11344e59c8498558f136997
BLAKE2b-256 checksum
How to use checksums
21b77859e5022083d056aae82504a7298f940bcacf35e313524253292b476120
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