Ecosystem

Pytron is more than just a backend library. It is supported by a growing ecosystem of tools designed to make the bridge between Python and Web technologies seamless and professional.

pytron-client

The core JavaScript bridge. It abstracts the IPC communication into direct, promise-based function calls. It also handles state synchronization and backend events.

bash
npm install pytron-client
javascript
import pytron from 'pytron-client';

// Call exposed Python functions
const result = await pytron.get_system_info();

// Listen to backend events
pytron.on('download:progress', (percent) => {
  console.log(`Progress: ${percent}%`);
});

// Access globally synced state
console.log(pytron.state.user);

pytron-ui

A professional-grade component library for React. It provides native-feeling desktop building blocks like draggable TitleBars, Sidebars, and specialized hooks.

bash
npm install pytron-ui
jsx
import { PytronTitleBar, PytronMenuBar, PytronSidebar, usePytron, PytronContextMenu, PytronShortcutHandler } from 'pytron-ui';

function App() {
  const { state, isLoading } = usePytron();

  return (
      <>
      {/* Draggable region with native window buttons */}
      <PytronTitleBar title="My App" variant="windows" />
      
      {/* Global Context Menu & Shortcuts */}
      <PytronContextMenu />
      <PytronShortcutHandler />

      <PytronSidebar>
        <PytronSidebar.Item active>Dashboard</PytronSidebar.Item>
      </PytronSidebar>

      <main>
        <h1>Welcome, {state.user}</h1>
      </main>
      </>
  );
}

Component Highlights

  • ContextMenu: A fully customizable, native-feeling context menu replacement.
  • ShortcutHandler: Seamlessly bridge React key events to Python backend commands.
  • TitleBars: Draggable regions with OS-aware window controls.