Skip to main content

PyWire is a lightweight Python library that allows you to create simple desktop GUI applications using HTML, CSS, and JavaScript, while giving full access to Python’s functionality and libraries.

Project description

PyWire 🚀

PyWire is a lightweight Python library that allows you to create simple desktop GUI applications using HTML, CSS, and JavaScript, while giving full access to Python’s functionality and libraries. It's designed to make cross-platform desktop app development with web technologies a breeze! ✨

💡 Inspiration

PyWire is heavily inspired by and aims to be compatible with the excellent Eel project. We've taken the core ideas and built upon them to provide a robust and easy-to-use solution for integrating Python with web frontends. Our goal is to offer a similar developer experience with additional features and optimizations. 🐍🌐

📦 Installation

You can install PyWire directly from PyPI:

pip install pywire-eel

Or from github

pip install git+https://github.com/Fadi002/PyWire

🌟 Features

  • Seamless Python-JavaScript Interoperability: Call Python functions from JavaScript and vice-versa with ease. 🔄
  • Cross-Platform Compatibility: Build apps that run on Windows, macOS, and Linux. 💻
  • Web Technologies: Leverage your existing knowledge of HTML, CSS, and JavaScript to build beautiful UIs. 🎨
  • Lightweight & Fast: Designed for performance and minimal overhead. ⚡
  • Eel-compatible API: Familiar API for developers coming from the Eel ecosystem. 🤝

🚀 Getting Started

Here's a quick example to get you started:

import pywire

@pywire.expose
def say_hello(name):
    print(f"Hello from Python: {name}!")
    return f"Hello, {name}! This is from Python."

pywire.init('web') # 'web' is the folder containing your HTML, CSS, JS files
pywire.start('index.html') # 'index.html' is your main HTML file

And in your web/index.html:

<!DOCTYPE html>
<html>
<head>
    <script src="bridge.js"></script> <!-- This must be included in your html -->
    <title>PyWire App</title>
    <script type="text/javascript" src="/pywire.js"></script>
    <script type="text/javascript">
        async function callPython() {
            let result = await pywire.say_hello("World");
            document.getElementById('output').innerText = result;
        }
    </script>
</head>
<body>
    <h1>Welcome to PyWire!</h1>
    <button onclick="callPython()">Call Python Function</button>
    <p id="output"></p>
</body>
</html>

🤝 Contributing

We welcome contributions! If you'd like to contribute, please fork the repository and create a pull request. For major changes, please open an issue first to discuss what you would like to change. 💖

📄 License

This project is licensed under the MIT License - see the LICENSE file for details. ©️

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

pywire_eel-0.1.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

pywire_eel-0.1.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file pywire_eel-0.1.1.tar.gz.

File metadata

  • Download URL: pywire_eel-0.1.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pywire_eel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2937bf83a5dcc3dca39c56980f91fc0f797c3090cdc2155b2bb7780dd6edb225
MD5 14d3e9d988715c26324cdb0053cbc1b7
BLAKE2b-256 d0e5e18ae2640f75b7953f9d6311a6551b786ef671d24975cde5bea32b64fb90

See more details on using hashes here.

File details

Details for the file pywire_eel-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pywire_eel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pywire_eel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3e57b6aef3c38fb9090b53c026515adcd34ccfaa6fef4c6a2a08d969a5fd9fc
MD5 cffe43abdacca2ec95ec652a15c7387a
BLAKE2b-256 a6d1afbaa7f960368c783e03e071ae14fb062c7ab22dc1b7dcb468f9635fa055

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