Skip to main content

PyPositron is a python framework for building apps with HTML, CSS and Python. itzmetanjim.github.io/py-positron/

Project description

PyPositron

PyPositron is currently in alpha stage. It is not yet ready for production use, but you can try it out and contribute to its development. See more in Contributing.

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 and frontend logic. (with support for both Python and JS)
  • Use any HTML/CSS framework (like Bootstrap, Tailwind, etc.) for your UI.
  • Use any HTML builder UI for your app (like Bootstrap Studio, Pinegrow, etc)
  • Use JS for compatibility with existing HTML/CSS frameworks.
  • Use AI tools for generating your UI without needing proprietary system prompts- simply tell it to generate HTML/CSS/JS UI for your app.
  • Virtual environment support.
  • Efficient installer creation for easy distribution (that does not exist yet) (The installer automatically finds an existing browser instead of installing a new one for every app like Electron.JS).

Why PyPositron?

Compared to Electron and other Python frameworks (like PyQt)-

Feature PyPositron Electron PyQt
Language Python JavaScript, C, C++, etc Python
UI Frameworks Only frontend HTML/CSS/JS Any Web technologies Qt Widgets
Packaging Efficient installer or standalone executable (not yet implemented) Electron Builder PyInstaller etc
Performance Lightweight Heavyweight Lightweight
AI Compatibility Yes Yes* No*
Compatibility All frontend HTML/CSS/JS frameworks All frontend and backend HTML/CSS/JS frameworks and web technologies Limited to Qt

* maybe

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

There should be directories in this structure-

your_app/
├── backend
│   └── main.py
├── frontend/
│   └── index.html
├── [win/linux]venv/ # If created
│   └──...
├── LICENSE #MIT by default
├── config.json
└── ...
  • backend/main.py: Entry point for your app.
  • frontend/index.html: Your app's UI (HTML/CSS/inline Python/JS).
  • winvenv/ or linuxvenv/:: (Optional) Virtual environment for dependencies.

2. Run Your App

positron start

This should open up a window with a checkmark and a button.

CLI Commands

Command Description
positron create Create a new PyPositron project (interactive setup).
positron start [--executable <python>] Run your PyPositron app (optionally specify Python interpreter).
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.

Contributing

This project is in alpha stage. Contributions are welcome. Things to do-

  • Make documentation and README that is not AI-generated
  • Add more examples and tutorials
  • Make the installer/executable creation system
  • Test on Linux
  • Add support for MacOS
  • Add building and packaging features (like converting to executables/installers that can run on any system without Python installed)
  • Optimize performance.

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

py_positron-0.0.2.3.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

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

py_positron-0.0.2.3-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

Details for the file py_positron-0.0.2.3.tar.gz.

File metadata

  • Download URL: py_positron-0.0.2.3.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for py_positron-0.0.2.3.tar.gz
Algorithm Hash digest
SHA256 6358b5097ab03ee873f7695722e6dfd4d43629b2be56372beb0ff7502dcb54c3
MD5 823a0729d1b0e5f9781db7be483eb3e0
BLAKE2b-256 3231c5e4db9f96dcca528f517e6898f52bd6f58e6a9db8cac8535617620d0bc6

See more details on using hashes here.

File details

Details for the file py_positron-0.0.2.3-py3-none-any.whl.

File metadata

  • Download URL: py_positron-0.0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 62.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for py_positron-0.0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 de75ef8828194fc7a046076bf97209dbd4545ac35f489817513bc625ad61e967
MD5 9d5316500f87553f8c70a536cd06c3fd
BLAKE2b-256 152c968f564f9f591ace85d6daaad2bc8090fc6893d48b570ca253cc9179155f

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