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))
app.use_state('count', 0)

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

# Add counter display
display = Text("count", tag='h1', className="text-2xl font-bold")
container.add(display)

# Add increment button
def increment():
    current = app.use_state('count')
    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.append(window)

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

🧩 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()

📖 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.0a4.tar.gz (32.5 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.0a4-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oneforall_gui-0.1.0a4.tar.gz
  • Upload date:
  • Size: 32.5 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.0a4.tar.gz
Algorithm Hash digest
SHA256 5f0bd46f9e4d5d5fa2137565dbf7995351fb9571c80a829ff07c1efe35d0e07a
MD5 d358e030c1ee775145314a41a80481fb
BLAKE2b-256 0d4f57bc46505f691f7c6aac92bbc19321d72e30f1ebb2187478345bb7d3eeec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oneforall_gui-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 872ae84235560ac2451dbbf0e0337da07b5e389f88fa0777ea7ceb00b8a19cfc
MD5 22f6550581b80da1588cb2bdd5f7e96b
BLAKE2b-256 98c0f1f450a154d540dee7f016ae556978c788843ccbeed0763a7cbe48ef7642

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