Skip to main content

OneForAll — lightweight Python GUI toolkit using pywebview and Python-only components.

Project description

OneForAll

⚠️ Alpha Version: OneForAll is currently in alpha. APIs may change and some features are still in development.

Build beautiful desktop apps with Python and Tailwind CSS.

OneForAll is a modern Python GUI framework that combines the simplicity of Python with the power of Tailwind CSS. Create responsive, beautiful desktop applications with hot reload, reactive state management, and a component-based architecture.

🚀 Quick Start

# Install OneForAll
pip install oneforall-gui

# Create a new app
oneforall init my_app
cd my_app

# Run with hot reload
oneforall dev example_basic.py

✨ Features

  • Pure Python - No HTML, CSS, or JavaScript required
  • Tailwind CSS - Beautiful styling with utility classes
  • Hot Reload - Instant updates during development
  • Component-Based - Reusable UI components
  • Reactive State - Automatic UI updates when state changes
  • Multi-Window - Support for multiple application windows
  • CLI Tools - Project scaffolding and development server

📖 Documentation

📚 Complete Documentation

Quick Links

💡 Simple Example

from oneforall import App, Window
from oneforall.components import Container, Text, Button

# Create app and window
app = App()
window = Window(title="Counter App", size=(300, 200))

# Create container with Tailwind classes
container = Container(className="p-8 text-center space-y-4")

# Add counter display
count = app.use_state('count', 0)
display = Text(f"Count: {count}", className="text-2xl font-bold")
container.add(display)

# Add increment button
def increment():
    current = app.use_state('count', 0)
    app.set_state('count', current + 1)

button = Button(
    "Click Me!", 
    on_click=increment,
    className="px-6 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
)
container.add(button)

# Run the app
window.add_child(container)
app.windows.append(window)

if __name__ == "__main__":
    app.run(dev_mode=True)

🧩 Core Components

# Text with styling
text = Text("Hello World", className="text-lg font-bold text-blue-600")

# Interactive button
button = Button("Click Me", on_click=handler, className="px-4 py-2 bg-green-500 text-white rounded")

# Layout container
container = Container(className="flex items-center justify-center p-4 space-x-2")

🎨 Tailwind CSS Styling

OneForAll includes full Tailwind CSS support:

# Flexbox layouts
Container(className="flex items-center justify-between")

# Responsive design
Text("Title", className="text-sm md:text-lg lg:text-xl")

# Hover effects
Button("Hover Me", className="bg-blue-500 hover:bg-blue-600 transition-colors")

⚡ CLI Commands

# Create new project
oneforall init my_project

# Development with hot reload
oneforall dev app.py

# Generate Tailwind CSS
oneforall css

🔄 State Management

Reactive state that automatically updates your UI:

app = App()

# Create reactive state
counter = app.use_state('counter', 0)

# State updates trigger UI re-renders
def increment():
    current = app.use_state('counter', 0)
    app.set_state('counter', current + 1)  # UI updates automatically

📖 Learn More: Check out the State Management Tutorial for advanced patterns and best practices.

🏗️ Example Apps

Counter App

from oneforall import App, Window
from oneforall.components import Container, Text, Button

app = App()
window = Window(title="Counter", size=(300, 200))
container = Container(className="p-8 text-center space-y-4")

count = app.use_state('count', 0)
display = Text(f"count", className="text-2xl font-bold")

def increment():
    current = app.use_state('count', 0)
    app.set_state('count', current + 1)

def decrement():
    current = app.use_state('count', 0)
    app.set_state('count', current - 1)

container.add(display)
container.add(Button("+", on_click=increment, className="mx-2 px-4 py-2 bg-green-500 text-white rounded"))
container.add(Button("-", on_click=decrement, className="mx-2 px-4 py-2 bg-red-500 text-white rounded"))

window.add_child(container)
app.windows.append(window)
app.run(dev_mode=True)

📖 More Examples: See the Tutorial Series for complete walkthroughs including Todo apps, layouts, and multi-window applications.

🔧 Custom Components

Create reusable components for your apps:

def Card(title, content, className=""):
    card = Container(className=f"p-6 bg-white rounded-lg shadow-md {className}")
    card.add(Text(title, className="text-xl font-bold mb-2"))
    card.add(Text(content, className="text-gray-600"))
    return card

# Usage
welcome_card = Card("Welcome", "Get started with OneForAll", "max-w-sm mx-auto")

📖 Learn More: Visit the Components Guide for advanced component patterns and composition techniques.

📚 Learning Resources

🆘 Need Help?

📄 License

This project is licensed under the Apache License 2.0.

You are free to use this framework in commercial and non-commercial projects.
Apps built with this framework can be proprietary or open-source.
The project name and branding are owned by Rohit Ahirwal and may not be used
to imply official affiliation without permission.


Built by Rohit Ahirwal | 📖 Documentation | 🐛 Issues

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

oneforall_gui-0.1.0a3.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

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

oneforall_gui-0.1.0a3-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file oneforall_gui-0.1.0a3.tar.gz.

File metadata

  • Download URL: oneforall_gui-0.1.0a3.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for oneforall_gui-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 99b124bd5c7434403859dec93212253a166b9118ba9369be51f8944b2d323211
MD5 17365a6a7861bb128d29f7e6324e70e0
BLAKE2b-256 41d1b8cb0c3429db92651da44a3b7369d26d60bc63e3fb623203349511e56191

See more details on using hashes here.

File details

Details for the file oneforall_gui-0.1.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for oneforall_gui-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 2eab6391bc33c1c39f17c92be120abb24c699584f2d7e44f89948633517287b1
MD5 d6a04e7bb995834e5585ae27a2a8b478
BLAKE2b-256 feebff2052cea3fc2772f827d6727c58124117b9223bf7d9b81e154b9987f034

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