Skip to main content

An Electron-like library for Python to build Cross Platform Apps

Project description

Pytron

Pytron Kit

PyPI Version Downloads License GitHub Website

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.

  1. Crystal Audit (💎): Uses sys.addaudithook (PEP 578) to execute your application and strictly record every module implementation used. No more "Missing Import" errors.
  2. Virtual Entry Point: Automatically generates a synthesized entry file (_virtual_root.py) containing only the Python APIs you explicitly exposed.
  3. Rust Engine (🦀): Compiles the virtual root into a native CPylib (app.pyd or app.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

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytron_kit-0.3.13.tar.gz (17.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pytron_kit-0.3.13-py3-none-win_amd64.whl (19.7 MB view details)

Uploaded Python 3Windows x86-64

pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl (20.5 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl (20.0 MB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

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

Hashes for pytron_kit-0.3.13.tar.gz
Algorithm Hash digest
SHA256 7b4cb34ac3509731c8022c00793b01626f29eb88490243987b9c55ba21f3cb52
MD5 f4ac6b29c11018299737825595d7859f
BLAKE2b-256 244f65033b5dc32b34bdc319ded2bfdafd93b603d18b7570b0bc4784a32fefac

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytron_kit-0.3.13.tar.gz:

Publisher: publish.yml on Ghua8088/pytron-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pytron_kit-0.3.13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f01483c1f5b16760cd09de8b3368c1d7cbdd7d6518430182c5b54fa187db7a4b
MD5 eb3a4ccf342d6a683a1401c5e9b1cc06
BLAKE2b-256 14b355a0d9a2d7fcc844b994fb36577045ad0c64626f06c87da599b4a3dde373

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pytron_kit-0.3.13-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 468b06168f787778a2923ec9a945a296b60eb43f801a3b113944390c79a08adf
MD5 214030c732199a6803903140ca3d1976
BLAKE2b-256 c65157bd97d66a6f87c5ee6b5037625727e307c0704237ab0fea33a5983494da

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pytron_kit-0.3.13-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 ee1e8eb913ca1aca5e72780165c06e3c4a34dbb497693e5c2b871d10edcc6522
MD5 1f74daa9a36e6ece5be1b7e356c4433b
BLAKE2b-256 26e103cb09f52d6ad7a975003bbf642d0ec5d672e72a091399e399b4795ba7fa

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page