Skip to main content

Build pywebview apps easily

Project description

webexe

Turn your HTML + Python project into a desktop application.

webexe uses pywebview to combine a web frontend with a Python backend, then optionally packages it into a Windows executable.

Features

  • Use HTML / CSS / JavaScript as your UI
  • Use Python as your backend
  • Expose selected Python APIs to JavaScript
  • Development mode with debugging support
  • Build standalone executable with PyInstaller

How it works

HTML / JS
    |
    v
pywebview
    |
    v
Python API
    |
    v
Windows EXE

Only functions exposed through api are available to the frontend.

Example:

# back.py

def hello():
    return "Hello from Python"


api = {
    "hello": hello
}

Frontend:

const result = await window.pywebview.api.hello();
console.log(result);

Installation

pip install webexe

Create a project

Your project should contain:

myapp/
│
├─ index.html
├─ back.py
└─ build.py

Development

Run:

python build.py --dev

Development mode:

  • Runs directly without packaging
  • Opens pywebview debug tools
  • Faster for testing

Build

Create executable:

python build.py

Output:

dist/
└─ MyApp.exe

Example

index.html

<!doctype html>

<html>
<body>

<h1>Hello webexe</h1>

<button onclick="test()">
    Call Python
</button>

<script>
async function test() {
    const result =
        await window.pywebview.api.hello();

    alert(result);
}
</script>

</body>
</html>

back.py

def hello():
    return "Hello from Python"


api = {
    "hello": hello
}

Why webexe?

Electron is powerful, but sometimes you only need:

  • A lightweight desktop shell
  • A web UI
  • Python automation/backend

webexe provides a simpler bridge between web technologies and Python.

Roadmap

  • webexe init project generator
  • Custom application name
  • Better error messages
  • More build options

Issues

Found a bug or have an idea?

Open an issue and include:

  • Python version
  • OS
  • webexe version
  • Error message
  • Steps to reproduce

License

MIT

Project details


Download files

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

Source Distribution

webexe-0.0.4.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

webexe-0.0.4-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file webexe-0.0.4.tar.gz.

File metadata

  • Download URL: webexe-0.0.4.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for webexe-0.0.4.tar.gz
Algorithm Hash digest
SHA256 084d0800266ec70b60c207d493dbe97a4f401ef5e5bb23f563e0090467d879a2
MD5 4efef62199f71d5d2ab71de7a59095c7
BLAKE2b-256 24db2a3a288389f7aca2d7f7e4c7a03a903cbe1eb33c93d4c94a37db8e4756b2

See more details on using hashes here.

File details

Details for the file webexe-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: webexe-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for webexe-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 364a977d1d9806f6dd52b24b5bda02b3785ac6ddba7c747fad08dfd961e2ec5e
MD5 5d64a5ff3ee0df9dfe4bd49355767325
BLAKE2b-256 98f58ac97a82f5f7884dd6b19fcd43e8a98a249f670d2bf6b8bf9f80c46d027e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page