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 in this repository:

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.32-cp312-cp312-win_amd64.whl (166.4 MB view details)

Uploaded CPython 3.12Windows x86-64

pytonium-0.0.32-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.32-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pytonium-0.0.32-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.32-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 08206825d0baf60b14236ae54f756feeaad2cbac16ed68bdc93d2fa3872c498f
MD5 0a9eb14342ce0401471cc5adeb2ad35b
BLAKE2b-256 5ffd7dcc06df68315918efe99a7ccfd7831158d3b5aa2bb527fb66f55247ae3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonium-0.0.32-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.32-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pytonium-0.0.32-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 65c05feac4cf0187fd182db2a3b8a0a5b147f6f8b681368139c422b3e549a702
MD5 a1718ed4b20b4f127f726bb577a5fb8f
BLAKE2b-256 6bfd797b69414cb1fd58f34f02cb1e2b9f56b45cf90b333598dde5df40fea64c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonium-0.0.32-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

This release

0.0.32 This release

2 files

0.0.31

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