桌面软件 活跃维护

pytauri

pytauri/pytauri

通过 Pyo3 为 Python 提供的 Tauri 绑定

1430
Stars 标星
30
Forks 分支
12
Watchers 关注
33
Open Issues
Rust
主要语言
Apache-2.0
开源协议
26.3 MB
仓库大小
1 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:pytauri/pytauri
git clone https://github.com/pytauri/pytauri.git
git clone git@github.com:pytauri/pytauri.git
README.md main

英文原文正文为项目原始 README(英文),本站后续会翻译为中文,当前仅剔除图片与无关章节并统一排版。

PyTauri

Tauri bindings for Python through Pyo3


CI: docs msrv requires-python Discord

Documentation: https://pytauri.github.io/pytauri/

Source Code: https://github.com/pytauri/pytauri/


This is a completely free and open-source project, but it is difficult to maintain without incentives and contributions from the community.

If you think this project is helpful, consider giving it a star GitHub Repo stars, it would be very helpful for my work and studies. 🥺👉👈


功能

TL;DR

You are hurry and just wanna see/run the demo? See examples/tauri-app.

  • Need Rust compiler, but almost don't need to write Rust code!

  • Or use pytauri-wheel, you won't need the Rust compiler, everything can be done in Python! Check out examples/tauri-app-wheel.

  • Can be integrated with tauri-cli to build and package standalone executables!

    • Use Cython to protect your source code!
  • No IPC (inter-process communication) overhead, secure and fast, thanks to Pyo3!

  • Support Tauri official plugins(e.g., notification), and you can write your own plugins!

  • Natively support async python (asyncio, trio or anyio)

  • 100% Type Completeness

  • Ergonomic API (and as close as possible to the Tauri Rust API)

    • Automatically generated TypeScript types and client for IPC

    • Python

      import sys
      
      from pydantic import BaseModel
      from pytauri import (
          AppHandle,
          Commands,
      )
      from pytauri_plugins.notification import NotificationExt
      
      commands: Commands = Commands()
      
      class Person(BaseModel):
          name: str
      
      class Greeting(BaseModel):
          message: str
      
      @commands.command()
      async def greet(body: Person, app_handle: AppHandle) -> Greeting:
          notification_builder = NotificationExt.builder(app_handle)
          notification_builder.show(title="Greeting", body=f"Hello, {body.name}!")
      
          return Greeting(
              message=f"Hello, {body.name}! You've been greeted from Python {sys.version}!"
          )
    • Frontend

      import { pyInvoke } from "tauri-plugin-pytauri-api";
      // or: `const { pyInvoke } = window.__TAURI__.pytauri;`
      
      export interface Person {
          name: string;
      }
      
      export interface Greeting {
          message: string;
      }
      
      export async function greet(body: Person): Promise<Greeting> {
          return await pyInvoke("greet", body);
      }
  • Can be integrated with nicegui/gradio/FastAPI to achieve a full-stack Python development experience (i.g., without Node.js). See examples/nicegui-app.

发布

We follow Semantic Versioning 2.0.0.

Rust and its Python bindings, PyTauri core and its plugins will keep the same MAJOR.MINOR version number.

name pypi crates.io npmjs
👉 core - - -
pytauri pytauri-pypi-v pytauri-crates-v
pytauri-core pytauri-core-crates-v
tauri-plugin-pytauri tauri-plugin-pytauri-crates-v tauri-plugin-pytauri-api-npm-v
👉 wheel - - -
pytauri-wheel pytauri-wheel-pypi-v
👉 utils - - -
pyo3-utils pyo3-utils-pypi-v pyo3-utils-crates-v
codelldb codelldb-pypi-v

理念

For Pythoneer

I hope PyTauri can become an alternative to pywebview and Pystray, leveraging Tauri's comprehensive features to offer Python developers a GUI framework and a batteries-included development experience similar to electron and PySide.

PyTauri is inspired by FastAPI and Pydantic, aiming to offer a similar development experience.

For Rustacean

Through Pyo3, I hope Rust developers can better utilize the Python ecosystem (e.g., building AI GUI applications with PyTorch).

Although Rust's lifetime and ownership system makes Rust code safer, Python's garbage collection (GC) will make life easier. 😆

使用者

Although PyTauri is a fairly young project, a few people have used it to make cool projects:

鸣谢

PyTauri is a project that aims to provide Python bindings for Tauri, a cross-platform webview GUI library. Tauri is a trademark of the Tauri Program within the Commons Conservancy and PyTauri is not officially endorsed or supported by them. PyTauri is an independent and community-driven effort that respects the original goals and values of Tauri. PyTauri does not claim any ownership or affiliation with the Tauri Program.

许可

This project is licensed under the terms of the Apache License 2.0.

本站来源与版权声明
  • 本文标题:pytauri - 通过 Pyo3 为 Python 提供的 Tauri
  • 本文链接:https://www.cn121.com/desktop/pytauri-pytauri.html
  • 原项目:pytauri/pytauri 版权归原作者 pytauri 及贡献者所有
  • 收录信息:本站于 2026-10-07 收录本项目,本页所列协议与仓库指标均为收录当时的状态;该日期之后原项目的版本更新与协议变更,本页不作同步。
  • 开源协议:收录时本项目采用 Apache-2.0(查看 LICENSE 原文),本站转载其原始文档(未改动文字,仅剔除图片与无关章节);使用、修改、分发请以该仓库 LICENSE 原文为准。本站对原文仅作排版与图片地址适配, 并保留原项目的 NOTICE 与署名要求。
  • 站点出处:本文首发于 OneTwoOne,收录自 GitHub 开源项目 pytauri/pytauri。
  • 内容说明:本页正文为原项目 README 原文(英文),本站后续会翻译为中文(当前尚未译出,仅将二级标题译为中文,便于按栏目定位;标题原文可在下方原仓库中查看),仅剔除了图片与赞助等无关章节、并把相对链接改为绝对地址;页首简介为机器翻译自仓库描述。
  • 引用声明:商业转载、第三方聚合或 AI 检索训练引用时,请务必保留以上来源出处、本文永久链接,以及原项目的版权声明与许可信息。
  • 下架通道:若原项目此后变更或收紧了许可协议、或作者/权利人认为本站的收录方式(译文、排版适配、简介翻译等)超出其授权范围,请通过 xyd3302001@163.com 发送下架通知,并附上项目地址与本页链接。本站核实后将第一时间删除本页内容,或改为不复制原文的目录性收录;署名更正等其他要求可一并提出。