An Electron-like library for Python to build Cross Platform Apps
Project description
Pytron Kit
Pytron-kit is a high-performance framework for building native ("parasitic") desktop apps using Python and Web Technologies (React, Vite). It combines the computational depth of Python (AI/ML) with the UI flexibility of the web, achieving a ~5MB footprint by utilizing the OS-native webview.
Linux Requirements
On Ubuntu/Debian, you must install the WebKitGTK headers and glib bindings before installing Pytron:
sudo apt-get install -y libcairo2-dev libgirepository-2.0-dev libglib2.0-dev pkg-config python3-dev libwebkit2gtk-4.1-dev gir1.2-gtk-4.0
Quick Start
# 1. Install
pip install pytron-kit
# 2. Create Project (React + Vite)
pytron init my_app
# 3. Run (Hot-Reloading)
pytron run --dev
Hello World
Python Backend (main.py)
from pytron import App
app = App()
@app.expose
def greet(name: str):
return f"Hello, {name} from Python!"
app.run()
Frontend (App.jsx)
import pytron from 'pytron-client';
const msg = await pytron.greet("User");
console.log(msg); // "Hello, User from Python!"
Key Features
- Agentic Shield (God Mode): The world's first Runtime-Audited Compiler. Pytron executes your app to map 100% of dynamic dependencies (Crystal Mode), tree-shakes the code into a Virtual Entry Point, and compiles it to a Native Extension using Rust & Zig.
- Adaptive Runtime: Use the Native Webview (~5MB) for efficiency or switch to the Chrome Engine (Electron) for 100% rendering parity.
- Zero-Copy Bridge: Stream raw binary data (video/tensors) from Python to JS at 60FPS via
pytron://, bypassing Base64 overhead. - Type-Safe: Automatically generates TypeScript definitions (
.d.ts) from your Python type hints. - Native Integration: Global shortcuts, Taskbar progress, System Tray, and Native File Dialogs.
The Agentic Shield
Pytron redefines Python distribution with a 3-stage security and optimization pipeline known as the Agentic Shield.
- Crystal Audit (💎): Uses
sys.addaudithook(PEP 578) to execute your application and strictly record every module implementation used. No more "Missing Import" errors. - Virtual Entry Point: Automatically generates a synthesized entry file (
_virtual_root.py) containing only the Python APIs you explicitly exposed. - Rust Engine (🦀): Compiles the virtual root into a native CPylib (
app.pydorapp.so) using Zig, and bundles it with a custom Rust Bootloader.
Packaging
# Standard Build (PyInstaller + Intelligent Hooks)
pytron package
# Crystal Build (Runtime Audit + Tree Shaking)
# *Requires user consent to execute code*
pytron package --crystal
# God Mode (Crystal Audit + Rust Compilation + Native Bootloader)
pytron package --engine rust --crystal
Documentation
- User Guide: Configuration, advanced APIs, and UI components.
- Architecture: Deep dive into the internal engineering and philosophy.
- Roadmap: Upcoming features.
- Contributing: How to help.
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytron_kit-0.3.13.tar.gz.
File metadata
- Download URL: pytron_kit-0.3.13.tar.gz
- Upload date:
- Size: 17.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b4cb34ac3509731c8022c00793b01626f29eb88490243987b9c55ba21f3cb52
|
|
| MD5 |
f4ac6b29c11018299737825595d7859f
|
|
| BLAKE2b-256 |
244f65033b5dc32b34bdc319ded2bfdafd93b603d18b7570b0bc4784a32fefac
|
Provenance
The following attestation bundles were made for pytron_kit-0.3.13.tar.gz:
Publisher:
publish.yml on Ghua8088/pytron-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytron_kit-0.3.13.tar.gz -
Subject digest:
7b4cb34ac3509731c8022c00793b01626f29eb88490243987b9c55ba21f3cb52 - Sigstore transparency entry: 920463561
- Sigstore integration time:
-
Permalink:
Ghua8088/pytron-kit@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ghua8088
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pytron_kit-0.3.13-py3-none-win_amd64.whl.
File metadata
- Download URL: pytron_kit-0.3.13-py3-none-win_amd64.whl
- Upload date:
- Size: 19.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f01483c1f5b16760cd09de8b3368c1d7cbdd7d6518430182c5b54fa187db7a4b
|
|
| MD5 |
eb3a4ccf342d6a683a1401c5e9b1cc06
|
|
| BLAKE2b-256 |
14b355a0d9a2d7fcc844b994fb36577045ad0c64626f06c87da599b4a3dde373
|
Provenance
The following attestation bundles were made for pytron_kit-0.3.13-py3-none-win_amd64.whl:
Publisher:
publish.yml on Ghua8088/pytron-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytron_kit-0.3.13-py3-none-win_amd64.whl -
Subject digest:
f01483c1f5b16760cd09de8b3368c1d7cbdd7d6518430182c5b54fa187db7a4b - Sigstore transparency entry: 920463597
- Sigstore integration time:
-
Permalink:
Ghua8088/pytron-kit@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ghua8088
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 20.5 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
468b06168f787778a2923ec9a945a296b60eb43f801a3b113944390c79a08adf
|
|
| MD5 |
214030c732199a6803903140ca3d1976
|
|
| BLAKE2b-256 |
c65157bd97d66a6f87c5ee6b5037625727e307c0704237ab0fea33a5983494da
|
Provenance
The following attestation bundles were made for pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
publish.yml on Ghua8088/pytron-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
468b06168f787778a2923ec9a945a296b60eb43f801a3b113944390c79a08adf - Sigstore transparency entry: 920463688
- Sigstore integration time:
-
Permalink:
Ghua8088/pytron-kit@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ghua8088
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl.
File metadata
- Download URL: pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 20.0 MB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee1e8eb913ca1aca5e72780165c06e3c4a34dbb497693e5c2b871d10edcc6522
|
|
| MD5 |
1f74daa9a36e6ece5be1b7e356c4433b
|
|
| BLAKE2b-256 |
26e103cb09f52d6ad7a975003bbf642d0ec5d672e72a091399e399b4795ba7fa
|
Provenance
The following attestation bundles were made for pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl:
Publisher:
publish.yml on Ghua8088/pytron-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl -
Subject digest:
ee1e8eb913ca1aca5e72780165c06e3c4a34dbb497693e5c2b871d10edcc6522 - Sigstore transparency entry: 920463640
- Sigstore integration time:
-
Permalink:
Ghua8088/pytron-kit@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ghua8088
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c3ea7a4fa8ee2c75c5745852f674434c8be2703 -
Trigger Event:
workflow_dispatch
-
Statement type: