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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywire_eel-0.1.0.tar.gz.
File metadata
- Download URL: pywire_eel-0.1.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
316c922a70aa621600a08ceeaf600e12e60700c578d247455a8bb63da4961070
|
|
| MD5 |
e99943babc79616ec4de380e9b28393d
|
|
| BLAKE2b-256 |
53720bae4081da1e8a13cb2a7a3faa6dc93b64ad205eb4adaee478f34b0feace
|
File details
Details for the file pywire_eel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pywire_eel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23a8a27c399ea66576e74163113018c40c0106dc249d33bfa70f6b9920c49ce3
|
|
| MD5 |
2cccf9ee5b5b31a4269a17ca2daa68eb
|
|
| BLAKE2b-256 |
ba3e9d8d0788b1ccfe124bf728bee5d3d490326d595a9d04e8efecd07caa5bb0
|