Skip to main content

Pytonium

Build Python desktop apps with HTML, CSS, and JavaScript.

Pytonium embeds the Chromium Embedded Framework (CEF 145 / Chromium 145) in Python, giving you the full power of modern web technologies for your desktop application UI.

PyPI Python 3.10+ License: MIT

Install

pip install Pytonium

Quick Start

import time
from Pytonium import Pytonium

p = Pytonium()
p.initialize("https://example.com", 800, 600)

while p.is_running():
    time.sleep(0.01)
    p.update_message_loop()

That's it -- a native desktop window running a full Chromium browser, in 7 lines of Python.

Features

  • Chromium rendering -- Full browser engine for HTML/CSS/JS, use React, Tailwind, or any web framework
  • Python-JS bridge -- Call Python functions from JavaScript, return values via Promises
  • State management -- Shared state between Python and JS with namespace subscriptions and DOM events
  • Custom URL schemes -- Map myapp:// to a local folder for loading HTML, assets, and 3D models
  • Frameless windows -- Build custom window chrome with HTML/CSS, Electron-style
  • Window control -- Position, size, minimize, maximize, fullscreen, drag, native handle access
  • Multi-instance -- Run multiple browser windows in a single process
  • TypeScript definitions -- Auto-generate .d.ts files for IDE auto-completion
  • Async support -- asyncio integration with run_pytonium_async
  • Event callbacks -- React to title changes, URL navigation, and fullscreen state
  • Cross-platform -- Windows 11 and Linux

Example: Python + JavaScript Interop

from Pytonium import Pytonium, returns_value_to_javascript

p = Pytonium()

@returns_value_to_javascript("any")
def get_data():
    return {"answer": 42, "source": "Python"}

p.bind_function_to_javascript(get_data, javascript_object="api")
p.initialize("file:///path/to/index.html", 800, 600)

while p.is_running():
    p.update_message_loop()
// In your HTML/JS -- wait for bindings, then call Python
if (window.PytoniumReady) {
    callPython();
} else {
    window.addEventListener('PytoniumReady', callPython);
}

async function callPython() {
    const result = await Pytonium.api.get_data();
    console.log(result.answer); // 42
}

Examples

Complete examples are included in the pytonium_examples/ directory:

Example Description
Simple App Bindings, state management, and context menus
Frameless Window Custom HTML/CSS titlebar with window controls
Babylon.js 3D 3D rendering with custom schemes and MIME types
Line Graph Real-time data visualization with state updates
Control Center Dashboard with multiple data panels
Data Studio Interactive data analysis tool

Documentation

Full documentation is available at maximilian-winter.github.io/pytonium, covering:

  • Getting Started -- Installation, quick start, and first app tutorial
  • Guides -- JS bindings, state management, frameless windows, async, and more
  • API Reference -- Complete Pytonium class reference (~35 methods)
  • Examples -- Walkthroughs of each example app
  • Building from Source -- Windows and Linux build instructions

Platform Support

Platform Status
Windows 11 Fully supported
Linux (X11) Fully supported
Python 3.10+ Required (64-bit)

Building from Source

See the Build Guide or how-to-build-from-source.md for detailed instructions.

# Quick version (Windows)
pip install build scikit-build cmake ninja Cython
cmake -B cmake-build-release -DCMAKE_BUILD_TYPE=Release
cmake --build cmake-build-release --target pytonium_subprocess --config Release
cd building_pythonium_core && python prepare_build.py --platform windows --build-dir ../cmake-build-release
cd ../src/pytonium_python_framework && python -m build --wheel
pip install dist/pytonium-*.whl --force-reinstall

License

MIT License -- Pytonium also includes CEF (BSD) and nlohmann/json (MIT).

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pytonium-0.0.31-cp312-cp312-win_amd64.whl (166.4 MB view details)

Uploaded CPython 3.12Windows x86-64

pytonium-0.0.31-cp312-cp312-manylinux_2_39_x86_64.whl (147.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

File details

Details for the file pytonium-0.0.31-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pytonium-0.0.31-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 166.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytonium-0.0.31-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 78c0dcfeda3fcbc60b835154a383e36832cb2c288504107dbd69d22182316948
MD5 199f546158675544d7ff4cf565e27a3e
BLAKE2b-256 6210e88f8b2e91da8e134f4d2eeb49530f11c822c60c5ed1d502955b0b34ae35

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonium-0.0.31-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on Maximilian-Winter/pytonium

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

File details

Details for the file pytonium-0.0.31-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pytonium-0.0.31-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3cb39a19d263179633b9e2fe0cd988555441875a4ede13f7974bd4f39a4a4cc2
MD5 c8b617f8821cca0d3b37bf2cc3deec60
BLAKE2b-256 55ec8e5c115c281c46bf7fc3046bc1543b17f6214f99d16994487dc4f599198f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonium-0.0.31-cp312-cp312-manylinux_2_39_x86_64.whl:

Publisher: build-wheels.yml on Maximilian-Winter/pytonium

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

Release history Release notifications | RSS feed

0.0.32

2 files

This release

0.0.31 This release

2 files

0.0.30

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

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