Skip to main content

A modern alternative to Gradio with stunning UI

Project description

olapp

A modern alternative to Gradio. Build ML demos and web apps with Python.

PyPI Python License Tests


Olapp UI Screenshot

Why Olapp?

  • Clean, professional UI — not generic AI styling. Looks like a real product.
  • Simple APIInterface for quick demos, Blocks for complex layouts
  • 25 components — Textbox, Slider, Image, Chatbot, Code, Gallery, and more
  • Real-time streaming — SSE-based live updates
  • Dark/light themes — built-in, no config needed
  • HuggingFace Spaces compatible — drop in app.py and go

Install

pip install olapp

Quick Start

import olapp

def greet(name, excitement):
    return f"Hello, {name}{'!' * int(excitement)}"

app = olapp.Interface(
    fn=greet,
    inputs=[
        olapp.Textbox(label="Name", placeholder="Enter your name"),
        olapp.Slider(minimum=1, maximum=10, value=3, label="Excitement"),
    ],
    outputs=olapp.Textbox(label="Greeting"),
    title="Greeter",
)
app.launch()

Blocks API

import olapp

with olapp.Blocks(title="My App") as app:
    with olapp.Row():
        inp = olapp.Textbox(label="Input")
        out = olapp.Textbox(label="Output")
    btn = olapp.Button("Run")
    app.click(fn=lambda x: x.upper(), inputs=inp, outputs=out)

app.launch()

Components

Component Description
Textbox Single/multi-line text input
Number Numeric input with +/- controls
Slider Range slider
Checkbox Boolean toggle
Dropdown Selection dropdown
Radio Radio button group
Button Clickable button
Image Image upload with drag & drop
Audio Audio upload & playback
Video Video upload & playback
File File upload
Dataframe Tabular data display
Markdown Markdown renderer
HTML Raw HTML display
Chatbot Chat message interface
State Hidden state storage
ColorPicker Color picker with hex input
DateTime Date/time picker
Code Code editor with monospace font
Gallery Image gallery grid
Label Classification labels with confidence bars
HighlightedText Text with labeled spans (NER, sentiment)
JSON JSON viewer
Progress Progress bar

Color Theme

Olapp uses a clean, professional color palette:

Token Light Dark Usage
Primary #6366f1 #818cf8 Buttons, links, accents
Success #059669 #059669 Success states
Warning #d97706 #d97706 Warning states
Error #dc2626 #dc2626 Error states
Background #ffffff #030712 Page background
Surface #ffffff #111827 Card backgrounds
Border #e5e7eb #1f2937 Borders and dividers
Text #111827 #f9fafb Primary text
Text Secondary #4b5563 #9ca3af Secondary text

Layout (Blocks)

with olapp.Blocks(title="Complex App") as app:
    with olapp.Row():
        with olapp.Column():
            inp = olapp.Textbox(label="Input")
        with olapp.Column():
            out = olapp.Textbox(label="Output")

    with olapp.Group():
        btn = olapp.Button("Process")
        app.click(fn=process, inputs=inp, outputs=out)

    with olapp.Tabs():
        with olapp.Tab("Results"):
            olapp.Markdown(value="Results here")
        with olapp.Tab("Settings"):
            olapp.Slider(label="Threshold", minimum=0, maximum=1, value=0.5)

HuggingFace Spaces

Create app.py:

import olapp

def predict(text):
    return text[::-1]

app = olapp.Interface(fn=predict, inputs="textbox", outputs="textbox", title="Reverser")
app.launch(server_name="0.0.0.0", server_port=7860)

requirements.txt:

olapp

Development

git clone https://github.com/Atum246/olapp.git
cd olapp
pip install -e .
python -m pytest tests/ -v

License

MIT

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

olapp-0.2.1.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

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

olapp-0.2.1-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file olapp-0.2.1.tar.gz.

File metadata

  • Download URL: olapp-0.2.1.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for olapp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4afde93a291df626a0b3213d471c506e3cd033cd37b0f3c406aa2c283e4565a2
MD5 2072ac1f1e46055f383706ceffdd41a7
BLAKE2b-256 cfcdb66658c8a0cf068f13c2c1ea809bd40acb04ba6a418a3d60e7f1d30b23d1

See more details on using hashes here.

File details

Details for the file olapp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: olapp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for olapp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 222c1e8fa6b55f0cded64ac36ee99034284551057dcde797688aee616362f70f
MD5 9fed4c26be6c8fe9025b05eabc1640d7
BLAKE2b-256 b74c45533a1a6708d564a2680bcba5cd4843e5977647e60ca5dac6ca79530925

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