A small example package
Project description
PyPositron
PyPositron is a Python-powered desktop app framework that lets you build cross-platform apps using HTML, CSS, and Python—just like Electron, but with Python as the backend. Write your UI in HTML/CSS, add interactivity with Python, and run your app natively!
Features
- Build desktop apps using HTML and CSS.
- Use Python for backend logic.
- Virtual environment support.
- Effecient installer creation for easy distribution (the installer automatically finds an existing browser instead of installing a new one for every app like Electron.JS).
Quick Start
1. Create a New Project
Install PyPositron if not already installed:
pip install py-positron
Them create a new project using the CLI:
positron create
# Follow the prompts to set up your project
cd <your_app_name>
2. Run Your App
positron start
3. Install Python Packages
positron install <package>
4. Create a Virtual Environment
positron venv
Example Project Structure
your_app/
├── main
│ └── main.py
├── views/
│ └── index.html
├── [win/linux]venv/
│ └──[bin/Scripts]/
│ ├── activate
│ ├── python.exe
│ └── ...
├──LICENSE
└── ...
- main_app.py: Entry point for your app.
- views/index.html: Your app's UI (HTML/CSS/inline Python).
- winvenv/ or linuxvenv/:: (Optional) Virtual environment for dependencies.
Example: Hello World App
main_app.py
import py_positron as main
# Run this file by typing 'positron start' in your project root.
main.openUI("views/index.html", None, 900, 700, title="Example app") #openUI opens a UI and starts automatically
print("Stopping...") #This runs after the app is closed
views/index.html
<!DOCTYPE html>
<html>
<head>
<title>Python-Powered App</title>
</head>
<body>
<h1>Hello from PyPositron!</h1>
<button id="button">Show Time</button>
<py>
import time
button = document.getElementById('button')
def button_handler():
document.alert("The current time is " + str(time.strftime("%H:%M:%S")))
button.addEventListener('click', button_handler)
</py>
<!--<script>
//You can also use JavaScript if you want.
</script>-->
</body>
</html>
CLI Commands
| Command | Description |
|---|---|
positron create |
Create a new PyPositron project (interactive setup). |
positron start |
Run your PyPositron app from the project root. |
positron install <package> |
Install a Python package into the project venv. |
positron venv |
Create a virtual environment inside your project folder. |
Documentation & Resources
License
GNU AGPL v3 License. See LICENSE 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 py_positron-0.0.1.15.tar.gz.
File metadata
- Download URL: py_positron-0.0.1.15.tar.gz
- Upload date:
- Size: 52.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3a1bfb3de2fee44a5ced124a702a4d2041c787c9a325498dd9cc44a488626cb
|
|
| MD5 |
746a1b04931354eb3235c838c65cfed6
|
|
| BLAKE2b-256 |
528b6a2f807addab9721550e10d3f6b20074c247de566ad1c981902c9978463f
|
File details
Details for the file py_positron-0.0.1.15-py3-none-any.whl.
File metadata
- Download URL: py_positron-0.0.1.15-py3-none-any.whl
- Upload date:
- Size: 55.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37afa757956e543b00ecc408b348cf89e6a4834c97d525f9a1175e296c7d0b12
|
|
| MD5 |
0c0a44febf534bf575342b51d6cd4bd3
|
|
| BLAKE2b-256 |
09a7f349db65f523ea3cc38b7d3c27e7fbe843a80ac6fb0515a6e138dfc146ee
|