Skip to main content

Pytron

Pytron Kit

Stop wrapping AI in boring API calls and web tabs. Turn Python scripts into full-fledged desktop applications.

Website PyPI Version Discord License


The Vision: Python is the Controller, JS is the UI

Python is the undisputed heart of AI, ML, and data processing — PyTorch, Ollama, Transformers, LangChain, Whisper, and OpenCV all live here. But traditionally, building desktop apps forced developers to make Node/JavaScript the main process while Python got demoted to an awkward "sidecar" subprocess.

Pytron Kit inverts the architecture:

  • Python is the Native Controller: Manages state, OS integrations, daemons, file systems, and heavy AI hardware directly.
  • JavaScript is the UI Controller: Renders beautiful, ultra-responsive web UIs (React, Vite, Next.js, Vue, Tailwind).

Instead of locking AI inside terminal scripts or browser tabs tied to requests.post(), Pytron is the ultimate Python-to-App Enabler — giving your Python logic native desktop superpowers, zero-latency IPC, and automatic TypeScript definitions.


Why Pytron Kit?

  • Built for AI & Python Workflows: Offload heavy Python models (Ollama, PyTorch, Whisper) to background thread pools effortlessly. Your UI stays smooth at 60 FPS while Python works.
  • Native or Chrome/Electron Engines: Use lightweight native OS WebViews by default, or run pytron run --chrome / pytron package --chrome to bundle Electron/Chromium for 100% cross-platform UI consistency!
  • Type-Safe Magic: Decorated Python functions auto-generate frontend TypeScript definitions (.d.ts). Calling Python from JS feels like calling a local function with full autocompletion!
  • Dual Hot-Reloading: Save frontend code -> Vite HMR updates UI instantly. Save Python backend code -> Pytron hot-restarts the backend automatically.
  • Full Desktop Superpowers: Daemons, system notifications, taskbar progress, dock badges, native file dialogs, system tray icons, and global shortcuts out of the box.
  • One-Command Standalone Executables: Ready to distribute? pytron package bundles your Python controller and web frontend into a compact binary (.exe, macOS app, Linux binary).

Show Me the Code: Build a Native AI Assistant in Seconds

1. Python Backend (main.py)

from pytron import App
from pydantic import BaseModel

app = App()

class Query(BaseModel):
    prompt: str

@app.expose
def ask_ai(query: Query) -> str:
    # Run local Ollama, PyTorch model, or agentic loop here!
    return f"AI Thinking on: {query.prompt}"

app.generate_types() # Auto-generates frontend/src/pytron.d.ts
app.run()

2. Frontend React / TypeScript (App.tsx)

import pytron from 'pytron-client';
import { useState } from 'react';

export function App() {
  const [response, setResponse] = useState('');

  async function handleAsk() {
    // Fully typed autocomplete for your Python methods!
    const answer = await pytron.ask_ai({ prompt: "Analyze local desktop files" });
    setResponse(answer);
  }

  return (
    <button onClick={handleAsk}>
      {response || "Run AI Agent"}
    </button>
  );
}

Quick Start

1. Install Pytron Kit

# Windows
pip install pytron-kit

# Linux / macOS (Recommended via pipx)
pipx install pytron-kit

2. Initialize Your App

Create a new app with your choice of frontend framework:

pytron init my_ai_app --template react

(Supported templates: react (default), next, vue, svelte, preact, solid, lit, qwik, vanilla)

3. Install & Run in Dev Mode

cd my_ai_app
pytron install

# Run with native OS webview
pytron run --dev

# Or run with Electron / Chrome engine
pytron run --dev --chrome

Platform Superpowers & Cross-Platform Support

  • Engine Flexibility: Switch between native webview engines or Electron (--chrome) seamlessly during dev and packaging.
  • Daemon & System Integration: Run in background mode, show/hide windows programmatically, emit cross-platform native OS notifications.
  • Taskbar & Dock Controls: Set taskbar progress bars, update app icons, and control macOS Dock badges.
  • Native Dialogs: Use native OS file dialogs (open, save, folder select) and message boxes without third-party popups.
  • Linux Schism Guard: Built-in GTK3 & WebKit2GTK isolation prevents GLib crashes automatically on Linux distros (Ubuntu 22.04 / 24.04+).

Packaging & Distribution

Ready to ship your app to users? Distribute it as a standalone desktop binary:

# Package with Native Webview
pytron package

# Package with Chrome / Electron engine
pytron package --chrome

Pytron handles current working directory safety (so app data writes cleanly to %APPDATA% or user configs without permission errors), splash screens (--splash), and bundle optimization.


CLI Reference

  • pytron init <name> [--template <template>] — Scaffold a new Pytron app.
  • pytron install — Smartly manage Python dependencies in a project virtual environment (env/).
  • pytron run [--dev] [--chrome] — Launch your app with dual hot-reloading (optionally with Chrome/Electron engine).
  • pytron frontend install <pkg> — Auto-install frontend npm dependencies.
  • pytron package [--chrome] — Build a standalone desktop executable (Native or Chrome/Electron).
  • pytron show — List installed environment packages.

Community & Support

Join the Pytron developer community on Discord! Whether you're building local AI agents, sleek utility tools, or native desktop dashboards:

Join the Discord Server

  • Get help and debug issues
  • Showcase what you're building
  • Suggest features and shape the roadmap

Documentation & Resources

Explore the detailed documentation and community resources:


Happy building with Pytron Kit!

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.15.post8.tar.gz (18.0 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.15.post8-py3-none-win_amd64.whl (20.5 MB view details)

Uploaded Python 3Windows x86-64

pytron_kit-0.3.15.post8-py3-none-manylinux_2_31_x86_64.whl (22.1 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

pytron_kit-0.3.15.post8-py3-none-macosx_11_0_universal2.whl (20.4 MB view details)

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

File details

Details for the file pytron_kit-0.3.15.post8.tar.gz.

File metadata

  • Download URL: pytron_kit-0.3.15.post8.tar.gz
  • Upload date:
  • Size: 18.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytron_kit-0.3.15.post8.tar.gz
Algorithm Hash digest
SHA256 8be4fef89c4dfdd2f7e20be08701d88a75ee5c436b88435ee42d167aba90b7b8
MD5 f0b24136926cafc8f139fa7fcadc2348
BLAKE2b-256 773b37bc142aef64343b0b7cd4144e5bf771baffdd2953fc82e41bdef4707d8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytron_kit-0.3.15.post8.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.15.post8-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pytron_kit-0.3.15.post8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 89517998b019b4c7f8d4dc3c82c70bef7832d0637593cad750a68c7d880db435
MD5 3269af6c053064d12ff33993ab057ef0
BLAKE2b-256 75c90dc21dae37a1771e60e992d867617e1944687a47e373aad677f467a3d629

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytron_kit-0.3.15.post8-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.15.post8-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for pytron_kit-0.3.15.post8-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2a0b052e0b24766df8dfb4987ebc3db078325af34f37343608d72b4dff95cbba
MD5 8db022aa1fff2d2f301afa44512843ae
BLAKE2b-256 150b2673ad046ece5e75457379be8a1ad2755b4935eab61287ba18419dd7edb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytron_kit-0.3.15.post8-py3-none-manylinux_2_31_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.15.post8-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pytron_kit-0.3.15.post8-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 80291afc4b3f646e7744cd12928e1636cb314c8e9e909d3ef4e635d0aa6e0564
MD5 11d3f08284a3ea77150fe7dff44b7c86
BLAKE2b-256 1bea287c33b93b175e16b569c5b9f888d285c8173da605921e4469b797cb2a2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytron_kit-0.3.15.post8-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.

Release history Release notifications | RSS feed

This release

0.3.15.post8 This release

4 files

0.3.14

4 files

0.3.13

4 files

0.3.5

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.3

2 files

0.1.0

2 files

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