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: MIT Tests

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

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.0.tar.gz (37.4 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.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: olapp-0.2.0.tar.gz
  • Upload date:
  • Size: 37.4 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.0.tar.gz
Algorithm Hash digest
SHA256 7551084f9e66489fac36acb14f23798697a049dc1760ca53b09dc990fb987e2b
MD5 9b51eec32326d5bbbd4e4ede2bf24600
BLAKE2b-256 ced9e48247cf60da565fcf3f91e1008461cc4357d95a93309c313874fe0e808d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: olapp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 748dd4184c31596ee7e21b2239157b1577116f9567e0bfedc8c821c63fd906b9
MD5 075e0fc56c42cab340c6a34105e0a935
BLAKE2b-256 c9e4eb305ae16e2e81bdde14b3e888476531d7b5c179c2ec74551d83423c3938

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