Introduction

Pytron-kit is a framework for developing desktop applications using Python for backend logic and Modern Web Technologies (React, Vue, Svelte, etc.) for the user interface.

By utilizing the operating system's native webview, Pytron-kit produces standalone binaries that use fewer resources than traditional browser-bundled frameworks.

Core Features

  • Python Backend: Full access to the Python ecosystem, including AI, ML, and data processing libraries.
  • Web Frontend: Build interfaces using standard web tools like React, Vue, or Tailwind CSS.
  • Native Bridge: Bidirectional, asynchronous communication between Python and JavaScript.
  • Source Protection: Native compilation and encryption to protect application logic.
  • Lightweight Binaries: Small distribution size by leveraging system-native components.

System Requirements (Linux)

On Linux distributions such as Ubuntu or Debian, the following development libraries are required:

bash
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

Installation and Setup

The Pytron CLI handles project initialization and development workflows.

bash
# 1. Install the toolkit
pip install pytron-kit

# 2. Create a new project
pytron init my_app

# 3. Start the development server
pytron run --dev

Example

Basic implementation of a bridge function between Python and JavaScript.

Python Backend (main.py)

python
from pytron import App

app = App()

@app.expose
def greet(name: str):
    return f"Hello, {name} from Python!"

app.run()

Frontend (App.jsx)

javascript
import pytron from 'pytron-client';

const msg = await pytron.greet("User");
console.log(msg); // "Hello, User from Python!"

Example Project: Agentic

Agentic is a desktop AI assistant built using the Pytron-kit engine. It serves as a reference for implementing system-level integrations and complex UI-backend interactions.