olapp 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- olapp-0.2.0/LICENSE +21 -0
- olapp-0.2.0/PKG-INFO +169 -0
- olapp-0.2.0/README.md +140 -0
- olapp-0.2.0/olapp/__init__.py +71 -0
- olapp-0.2.0/olapp/blocks.py +431 -0
- olapp-0.2.0/olapp/components.py +787 -0
- olapp-0.2.0/olapp/interface.py +150 -0
- olapp-0.2.0/olapp/routes.py +126 -0
- olapp-0.2.0/olapp/server.py +238 -0
- olapp-0.2.0/olapp/static/olapp.css +1287 -0
- olapp-0.2.0/olapp/static/olapp.js +718 -0
- olapp-0.2.0/olapp/templates/index.html +83 -0
- olapp-0.2.0/olapp/utils.py +126 -0
- olapp-0.2.0/olapp/version.py +1 -0
- olapp-0.2.0/olapp.egg-info/PKG-INFO +169 -0
- olapp-0.2.0/olapp.egg-info/SOURCES.txt +26 -0
- olapp-0.2.0/olapp.egg-info/dependency_links.txt +1 -0
- olapp-0.2.0/olapp.egg-info/requires.txt +6 -0
- olapp-0.2.0/olapp.egg-info/top_level.txt +1 -0
- olapp-0.2.0/pyproject.toml +56 -0
- olapp-0.2.0/setup.cfg +4 -0
- olapp-0.2.0/setup.py +61 -0
- olapp-0.2.0/tests/test_blocks.py +171 -0
- olapp-0.2.0/tests/test_components.py +329 -0
- olapp-0.2.0/tests/test_install.py +152 -0
- olapp-0.2.0/tests/test_interface.py +110 -0
- olapp-0.2.0/tests/test_routes.py +84 -0
- olapp-0.2.0/tests/test_server.py +109 -0
olapp-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Olapp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
olapp-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: olapp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A modern alternative to Gradio with stunning UI
|
|
5
|
+
Home-page: https://github.com/olapp/olapp
|
|
6
|
+
Author: Olapp Team
|
|
7
|
+
Author-email: Olapp Team <hello@olapp.dev>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/Atum246/olapp
|
|
10
|
+
Project-URL: Documentation, https://github.com/Atum246/olapp#readme
|
|
11
|
+
Project-URL: Repository, https://github.com/Atum246/olapp
|
|
12
|
+
Project-URL: Issues, https://github.com/Atum246/olapp/issues
|
|
13
|
+
Keywords: gradio,ui,web,ml,machine-learning,demo
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
|
|
30
|
+
# Olapp
|
|
31
|
+
|
|
32
|
+
**A modern alternative to Gradio. Build ML demos and web apps with Python.**
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/olapp/)
|
|
35
|
+
[](https://pypi.org/project/olapp/)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
[](#)
|
|
38
|
+
|
|
39
|
+
## Why Olapp?
|
|
40
|
+
|
|
41
|
+
- **Clean, professional UI** — not generic AI styling. Looks like a real product.
|
|
42
|
+
- **Simple API** — `Interface` for quick demos, `Blocks` for complex layouts
|
|
43
|
+
- **25 components** — Textbox, Slider, Image, Chatbot, Code, Gallery, and more
|
|
44
|
+
- **Real-time streaming** — SSE-based live updates
|
|
45
|
+
- **Dark/light themes** — built-in, no config needed
|
|
46
|
+
- **HuggingFace Spaces compatible** — drop in `app.py` and go
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install olapp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import olapp
|
|
58
|
+
|
|
59
|
+
def greet(name, excitement):
|
|
60
|
+
return f"Hello, {name}{'!' * int(excitement)}"
|
|
61
|
+
|
|
62
|
+
app = olapp.Interface(
|
|
63
|
+
fn=greet,
|
|
64
|
+
inputs=[
|
|
65
|
+
olapp.Textbox(label="Name", placeholder="Enter your name"),
|
|
66
|
+
olapp.Slider(minimum=1, maximum=10, value=3, label="Excitement"),
|
|
67
|
+
],
|
|
68
|
+
outputs=olapp.Textbox(label="Greeting"),
|
|
69
|
+
title="Greeter",
|
|
70
|
+
)
|
|
71
|
+
app.launch()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Blocks API
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import olapp
|
|
78
|
+
|
|
79
|
+
with olapp.Blocks(title="My App") as app:
|
|
80
|
+
with olapp.Row():
|
|
81
|
+
inp = olapp.Textbox(label="Input")
|
|
82
|
+
out = olapp.Textbox(label="Output")
|
|
83
|
+
btn = olapp.Button("Run")
|
|
84
|
+
app.click(fn=lambda x: x.upper(), inputs=inp, outputs=out)
|
|
85
|
+
|
|
86
|
+
app.launch()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Components
|
|
90
|
+
|
|
91
|
+
| Component | Description |
|
|
92
|
+
|-----------|-------------|
|
|
93
|
+
| `Textbox` | Single/multi-line text input |
|
|
94
|
+
| `Number` | Numeric input with +/- controls |
|
|
95
|
+
| `Slider` | Range slider |
|
|
96
|
+
| `Checkbox` | Boolean toggle |
|
|
97
|
+
| `Dropdown` | Selection dropdown |
|
|
98
|
+
| `Radio` | Radio button group |
|
|
99
|
+
| `Button` | Clickable button |
|
|
100
|
+
| `Image` | Image upload with drag & drop |
|
|
101
|
+
| `Audio` | Audio upload & playback |
|
|
102
|
+
| `Video` | Video upload & playback |
|
|
103
|
+
| `File` | File upload |
|
|
104
|
+
| `Dataframe` | Tabular data display |
|
|
105
|
+
| `Markdown` | Markdown renderer |
|
|
106
|
+
| `HTML` | Raw HTML display |
|
|
107
|
+
| `Chatbot` | Chat message interface |
|
|
108
|
+
| `State` | Hidden state storage |
|
|
109
|
+
| `ColorPicker` | Color picker with hex input |
|
|
110
|
+
| `DateTime` | Date/time picker |
|
|
111
|
+
| `Code` | Code editor with monospace font |
|
|
112
|
+
| `Gallery` | Image gallery grid |
|
|
113
|
+
| `Label` | Classification labels with confidence bars |
|
|
114
|
+
| `HighlightedText` | Text with labeled spans (NER, sentiment) |
|
|
115
|
+
| `JSON` | JSON viewer |
|
|
116
|
+
| `Progress` | Progress bar |
|
|
117
|
+
|
|
118
|
+
## Layout (Blocks)
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
with olapp.Blocks(title="Complex App") as app:
|
|
122
|
+
with olapp.Row():
|
|
123
|
+
with olapp.Column():
|
|
124
|
+
inp = olapp.Textbox(label="Input")
|
|
125
|
+
with olapp.Column():
|
|
126
|
+
out = olapp.Textbox(label="Output")
|
|
127
|
+
|
|
128
|
+
with olapp.Group():
|
|
129
|
+
btn = olapp.Button("Process")
|
|
130
|
+
app.click(fn=process, inputs=inp, outputs=out)
|
|
131
|
+
|
|
132
|
+
with olapp.Tabs():
|
|
133
|
+
with olapp.Tab("Results"):
|
|
134
|
+
olapp.Markdown(value="Results here")
|
|
135
|
+
with olapp.Tab("Settings"):
|
|
136
|
+
olapp.Slider(label="Threshold", minimum=0, maximum=1, value=0.5)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## HuggingFace Spaces
|
|
140
|
+
|
|
141
|
+
Create `app.py`:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
import olapp
|
|
145
|
+
|
|
146
|
+
def predict(text):
|
|
147
|
+
return text[::-1]
|
|
148
|
+
|
|
149
|
+
app = olapp.Interface(fn=predict, inputs="textbox", outputs="textbox", title="Reverser")
|
|
150
|
+
app.launch(server_name="0.0.0.0", server_port=7860)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`requirements.txt`:
|
|
154
|
+
```
|
|
155
|
+
olapp
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Development
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
git clone https://github.com/Atum246/olapp.git
|
|
162
|
+
cd olapp
|
|
163
|
+
pip install -e .
|
|
164
|
+
python -m pytest tests/ -v
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT
|
olapp-0.2.0/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Olapp
|
|
2
|
+
|
|
3
|
+
**A modern alternative to Gradio. Build ML demos and web apps with Python.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/olapp/)
|
|
6
|
+
[](https://pypi.org/project/olapp/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](#)
|
|
9
|
+
|
|
10
|
+
## Why Olapp?
|
|
11
|
+
|
|
12
|
+
- **Clean, professional UI** — not generic AI styling. Looks like a real product.
|
|
13
|
+
- **Simple API** — `Interface` for quick demos, `Blocks` for complex layouts
|
|
14
|
+
- **25 components** — Textbox, Slider, Image, Chatbot, Code, Gallery, and more
|
|
15
|
+
- **Real-time streaming** — SSE-based live updates
|
|
16
|
+
- **Dark/light themes** — built-in, no config needed
|
|
17
|
+
- **HuggingFace Spaces compatible** — drop in `app.py` and go
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install olapp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import olapp
|
|
29
|
+
|
|
30
|
+
def greet(name, excitement):
|
|
31
|
+
return f"Hello, {name}{'!' * int(excitement)}"
|
|
32
|
+
|
|
33
|
+
app = olapp.Interface(
|
|
34
|
+
fn=greet,
|
|
35
|
+
inputs=[
|
|
36
|
+
olapp.Textbox(label="Name", placeholder="Enter your name"),
|
|
37
|
+
olapp.Slider(minimum=1, maximum=10, value=3, label="Excitement"),
|
|
38
|
+
],
|
|
39
|
+
outputs=olapp.Textbox(label="Greeting"),
|
|
40
|
+
title="Greeter",
|
|
41
|
+
)
|
|
42
|
+
app.launch()
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Blocks API
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import olapp
|
|
49
|
+
|
|
50
|
+
with olapp.Blocks(title="My App") as app:
|
|
51
|
+
with olapp.Row():
|
|
52
|
+
inp = olapp.Textbox(label="Input")
|
|
53
|
+
out = olapp.Textbox(label="Output")
|
|
54
|
+
btn = olapp.Button("Run")
|
|
55
|
+
app.click(fn=lambda x: x.upper(), inputs=inp, outputs=out)
|
|
56
|
+
|
|
57
|
+
app.launch()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Components
|
|
61
|
+
|
|
62
|
+
| Component | Description |
|
|
63
|
+
|-----------|-------------|
|
|
64
|
+
| `Textbox` | Single/multi-line text input |
|
|
65
|
+
| `Number` | Numeric input with +/- controls |
|
|
66
|
+
| `Slider` | Range slider |
|
|
67
|
+
| `Checkbox` | Boolean toggle |
|
|
68
|
+
| `Dropdown` | Selection dropdown |
|
|
69
|
+
| `Radio` | Radio button group |
|
|
70
|
+
| `Button` | Clickable button |
|
|
71
|
+
| `Image` | Image upload with drag & drop |
|
|
72
|
+
| `Audio` | Audio upload & playback |
|
|
73
|
+
| `Video` | Video upload & playback |
|
|
74
|
+
| `File` | File upload |
|
|
75
|
+
| `Dataframe` | Tabular data display |
|
|
76
|
+
| `Markdown` | Markdown renderer |
|
|
77
|
+
| `HTML` | Raw HTML display |
|
|
78
|
+
| `Chatbot` | Chat message interface |
|
|
79
|
+
| `State` | Hidden state storage |
|
|
80
|
+
| `ColorPicker` | Color picker with hex input |
|
|
81
|
+
| `DateTime` | Date/time picker |
|
|
82
|
+
| `Code` | Code editor with monospace font |
|
|
83
|
+
| `Gallery` | Image gallery grid |
|
|
84
|
+
| `Label` | Classification labels with confidence bars |
|
|
85
|
+
| `HighlightedText` | Text with labeled spans (NER, sentiment) |
|
|
86
|
+
| `JSON` | JSON viewer |
|
|
87
|
+
| `Progress` | Progress bar |
|
|
88
|
+
|
|
89
|
+
## Layout (Blocks)
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
with olapp.Blocks(title="Complex App") as app:
|
|
93
|
+
with olapp.Row():
|
|
94
|
+
with olapp.Column():
|
|
95
|
+
inp = olapp.Textbox(label="Input")
|
|
96
|
+
with olapp.Column():
|
|
97
|
+
out = olapp.Textbox(label="Output")
|
|
98
|
+
|
|
99
|
+
with olapp.Group():
|
|
100
|
+
btn = olapp.Button("Process")
|
|
101
|
+
app.click(fn=process, inputs=inp, outputs=out)
|
|
102
|
+
|
|
103
|
+
with olapp.Tabs():
|
|
104
|
+
with olapp.Tab("Results"):
|
|
105
|
+
olapp.Markdown(value="Results here")
|
|
106
|
+
with olapp.Tab("Settings"):
|
|
107
|
+
olapp.Slider(label="Threshold", minimum=0, maximum=1, value=0.5)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## HuggingFace Spaces
|
|
111
|
+
|
|
112
|
+
Create `app.py`:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
import olapp
|
|
116
|
+
|
|
117
|
+
def predict(text):
|
|
118
|
+
return text[::-1]
|
|
119
|
+
|
|
120
|
+
app = olapp.Interface(fn=predict, inputs="textbox", outputs="textbox", title="Reverser")
|
|
121
|
+
app.launch(server_name="0.0.0.0", server_port=7860)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`requirements.txt`:
|
|
125
|
+
```
|
|
126
|
+
olapp
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
git clone https://github.com/Atum246/olapp.git
|
|
133
|
+
cd olapp
|
|
134
|
+
pip install -e .
|
|
135
|
+
python -m pytest tests/ -v
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""olapp — A modern alternative to Gradio."""
|
|
2
|
+
|
|
3
|
+
from .version import __version__
|
|
4
|
+
from .components import (
|
|
5
|
+
Component,
|
|
6
|
+
Textbox,
|
|
7
|
+
Number,
|
|
8
|
+
Slider,
|
|
9
|
+
Checkbox,
|
|
10
|
+
Dropdown,
|
|
11
|
+
Radio,
|
|
12
|
+
Button,
|
|
13
|
+
Image,
|
|
14
|
+
Audio,
|
|
15
|
+
Video,
|
|
16
|
+
File,
|
|
17
|
+
Dataframe,
|
|
18
|
+
Markdown,
|
|
19
|
+
HTML,
|
|
20
|
+
Chatbot,
|
|
21
|
+
State,
|
|
22
|
+
ColorPicker,
|
|
23
|
+
DateTime,
|
|
24
|
+
Code,
|
|
25
|
+
Gallery,
|
|
26
|
+
Label,
|
|
27
|
+
HighlightedText,
|
|
28
|
+
JSON,
|
|
29
|
+
Progress,
|
|
30
|
+
)
|
|
31
|
+
from .interface import Interface
|
|
32
|
+
from .blocks import Blocks, Row, Column, Group, Tab, Tabs, Accordion
|
|
33
|
+
from .server import OlappServer
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
"__version__",
|
|
37
|
+
"Interface",
|
|
38
|
+
"Blocks",
|
|
39
|
+
"Row",
|
|
40
|
+
"Column",
|
|
41
|
+
"Group",
|
|
42
|
+
"Tab",
|
|
43
|
+
"Tabs",
|
|
44
|
+
"Accordion",
|
|
45
|
+
"Component",
|
|
46
|
+
"Textbox",
|
|
47
|
+
"Number",
|
|
48
|
+
"Slider",
|
|
49
|
+
"Checkbox",
|
|
50
|
+
"Dropdown",
|
|
51
|
+
"Radio",
|
|
52
|
+
"Button",
|
|
53
|
+
"Image",
|
|
54
|
+
"Audio",
|
|
55
|
+
"Video",
|
|
56
|
+
"File",
|
|
57
|
+
"Dataframe",
|
|
58
|
+
"Markdown",
|
|
59
|
+
"HTML",
|
|
60
|
+
"Chatbot",
|
|
61
|
+
"State",
|
|
62
|
+
"ColorPicker",
|
|
63
|
+
"DateTime",
|
|
64
|
+
"Code",
|
|
65
|
+
"Gallery",
|
|
66
|
+
"Label",
|
|
67
|
+
"HighlightedText",
|
|
68
|
+
"JSON",
|
|
69
|
+
"Progress",
|
|
70
|
+
"OlappServer",
|
|
71
|
+
]
|