frame2app 0.1.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.
- frame2app-0.1.0/LICENSE +21 -0
- frame2app-0.1.0/PKG-INFO +243 -0
- frame2app-0.1.0/README.md +218 -0
- frame2app-0.1.0/frame2app/__init__.py +10 -0
- frame2app-0.1.0/frame2app/core.py +673 -0
- frame2app-0.1.0/frame2app.egg-info/PKG-INFO +243 -0
- frame2app-0.1.0/frame2app.egg-info/SOURCES.txt +10 -0
- frame2app-0.1.0/frame2app.egg-info/dependency_links.txt +1 -0
- frame2app-0.1.0/frame2app.egg-info/requires.txt +3 -0
- frame2app-0.1.0/frame2app.egg-info/top_level.txt +1 -0
- frame2app-0.1.0/pyproject.toml +48 -0
- frame2app-0.1.0/setup.cfg +4 -0
frame2app-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Your Name
|
|
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.
|
frame2app-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: frame2app
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Flexible DataFrame-based GUI builder for Colab and Jupyter using ipywidgets.
|
|
5
|
+
Author-email: Furqan Rustam <furqan.rustam1@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/frame2app
|
|
8
|
+
Project-URL: Repository, https://github.com/yourusername/frame2app
|
|
9
|
+
Project-URL: Issues, https://github.com/yourusername/frame2app/issues
|
|
10
|
+
Keywords: ipywidgets,jupyter,colab,gui,dataframe,pandas,form-builder,machine-learning,notebook
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Framework :: Jupyter
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: pandas>=1.3
|
|
22
|
+
Requires-Dist: ipywidgets>=8.0
|
|
23
|
+
Requires-Dist: IPython>=7.0
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Frame2App
|
|
27
|
+
|
|
28
|
+
Frame2App is a flexible DataFrame-based GUI builder for Google Colab and Jupyter Notebook using `ipywidgets`.
|
|
29
|
+
|
|
30
|
+
It creates interactive GUI forms from pandas DataFrames and lets users attach any custom Python function behind any button.
|
|
31
|
+
|
|
32
|
+
## Main idea
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
DataFrame + automatic/manual/hybrid field configuration + flexible callbacks
|
|
36
|
+
→ notebook GUI
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- Fully automatic GUI generation from a DataFrame
|
|
42
|
+
- Fully manual field configuration
|
|
43
|
+
- Hybrid mode: automatic for most fields, customized overrides for selected fields
|
|
44
|
+
- Flexible button names
|
|
45
|
+
- Flexible callback functions
|
|
46
|
+
- Built-in actions: `reset`, `clear_output`, `show_values`, `to_dataframe`, `validate`
|
|
47
|
+
- Validation support
|
|
48
|
+
- Export values as dictionary, DataFrame, or JSON
|
|
49
|
+
- Layouts: `vertical`, `grid`, `horizontal`, `accordion`
|
|
50
|
+
- Works in Google Colab and Jupyter Notebook
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install frame2app
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For Google Colab:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
!pip install frame2app
|
|
62
|
+
from google.colab import output
|
|
63
|
+
output.enable_custom_widget_manager()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Basic automatic usage
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import pandas as pd
|
|
70
|
+
from frame2app import AutoForm
|
|
71
|
+
|
|
72
|
+
sample_df = pd.DataFrame({
|
|
73
|
+
"age": [18, 25, 32, 45, 60],
|
|
74
|
+
"income": [20000, 35000, 50000, 70000, 90000],
|
|
75
|
+
"gender": ["Male", "Female", "Female", "Male", "Female"],
|
|
76
|
+
"city": ["London", "Dublin", "Paris", "London", "Berlin"],
|
|
77
|
+
"has_account": [True, False, True, True, False],
|
|
78
|
+
"target": [0, 1, 0, 1, 1]
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
def run_anything(values):
|
|
82
|
+
print("Values received:")
|
|
83
|
+
print(values)
|
|
84
|
+
|
|
85
|
+
app = AutoForm(
|
|
86
|
+
data=sample_df,
|
|
87
|
+
target="target",
|
|
88
|
+
title="Automatic GUI",
|
|
89
|
+
buttons={
|
|
90
|
+
"Run Anything": run_anything,
|
|
91
|
+
"Show Values": "show_values",
|
|
92
|
+
"As DataFrame": "to_dataframe",
|
|
93
|
+
"Reset": "reset",
|
|
94
|
+
"Clear Output": "clear_output",
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
app.display()
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Hybrid automatic + customized fields
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
app = AutoForm(
|
|
105
|
+
data=sample_df,
|
|
106
|
+
target="target",
|
|
107
|
+
fields="auto",
|
|
108
|
+
overrides={
|
|
109
|
+
"age": {
|
|
110
|
+
"widget": "int_slider",
|
|
111
|
+
"min": 18,
|
|
112
|
+
"max": 100,
|
|
113
|
+
"step": 1,
|
|
114
|
+
"default": 30,
|
|
115
|
+
},
|
|
116
|
+
"gender": {
|
|
117
|
+
"widget": "radio",
|
|
118
|
+
"options": ["Male", "Female"],
|
|
119
|
+
"default": "Female",
|
|
120
|
+
},
|
|
121
|
+
"city": {
|
|
122
|
+
"widget": "combobox",
|
|
123
|
+
"options": ["London", "Dublin", "Paris", "Berlin", "New York"],
|
|
124
|
+
"default": "London",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
buttons={
|
|
128
|
+
"Submit": run_anything,
|
|
129
|
+
"Validate": "validate",
|
|
130
|
+
"Reset": "reset",
|
|
131
|
+
},
|
|
132
|
+
layout="grid",
|
|
133
|
+
title="Hybrid Auto + Custom GUI"
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
app.display()
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Fully manual fields
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
app = AutoForm(
|
|
143
|
+
data=sample_df,
|
|
144
|
+
fields={
|
|
145
|
+
"age": {
|
|
146
|
+
"widget": "int_slider",
|
|
147
|
+
"min": 18,
|
|
148
|
+
"max": 100,
|
|
149
|
+
"default": 30,
|
|
150
|
+
"required": True,
|
|
151
|
+
},
|
|
152
|
+
"income": {
|
|
153
|
+
"widget": "int_text",
|
|
154
|
+
"default": 50000,
|
|
155
|
+
"validator": lambda value: (value >= 0, "Income must be non-negative."),
|
|
156
|
+
},
|
|
157
|
+
"gender": {
|
|
158
|
+
"widget": "dropdown",
|
|
159
|
+
"options": ["Male", "Female"],
|
|
160
|
+
"default": "Male",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
buttons={
|
|
164
|
+
"Process": run_anything,
|
|
165
|
+
"Reset": "reset",
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
app.display()
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Supported widget names
|
|
173
|
+
|
|
174
|
+
- `int_slider`
|
|
175
|
+
- `float_slider`
|
|
176
|
+
- `range_slider`
|
|
177
|
+
- `float_range_slider`
|
|
178
|
+
- `int_text`
|
|
179
|
+
- `float_text`
|
|
180
|
+
- `dropdown`
|
|
181
|
+
- `combobox`
|
|
182
|
+
- `radio`
|
|
183
|
+
- `select_multiple`
|
|
184
|
+
- `checkbox`
|
|
185
|
+
- `textarea`
|
|
186
|
+
- `date_picker`
|
|
187
|
+
- `password`
|
|
188
|
+
- `file_upload`
|
|
189
|
+
- `text`
|
|
190
|
+
- `html`
|
|
191
|
+
|
|
192
|
+
## Built-in button actions
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
buttons={
|
|
196
|
+
"Show Values": "show_values",
|
|
197
|
+
"Show DataFrame": "to_dataframe",
|
|
198
|
+
"Validate": "validate",
|
|
199
|
+
"Reset": "reset",
|
|
200
|
+
"Clear Output": "clear_output",
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Custom button function
|
|
205
|
+
|
|
206
|
+
Every custom function receives the current form values as a dictionary.
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
def my_function(values):
|
|
210
|
+
print(values)
|
|
211
|
+
|
|
212
|
+
app = AutoForm(
|
|
213
|
+
data=sample_df,
|
|
214
|
+
buttons={"Run My Function": my_function}
|
|
215
|
+
)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Export values
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
values = app.get_values()
|
|
222
|
+
row_df = app.to_dataframe()
|
|
223
|
+
json_data = app.to_json()
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Local development
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pip install -e .
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Build
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
pip install build twine
|
|
236
|
+
python -m build
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Publish
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
twine upload dist/*
|
|
243
|
+
```
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Frame2App
|
|
2
|
+
|
|
3
|
+
Frame2App is a flexible DataFrame-based GUI builder for Google Colab and Jupyter Notebook using `ipywidgets`.
|
|
4
|
+
|
|
5
|
+
It creates interactive GUI forms from pandas DataFrames and lets users attach any custom Python function behind any button.
|
|
6
|
+
|
|
7
|
+
## Main idea
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
DataFrame + automatic/manual/hybrid field configuration + flexible callbacks
|
|
11
|
+
→ notebook GUI
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- Fully automatic GUI generation from a DataFrame
|
|
17
|
+
- Fully manual field configuration
|
|
18
|
+
- Hybrid mode: automatic for most fields, customized overrides for selected fields
|
|
19
|
+
- Flexible button names
|
|
20
|
+
- Flexible callback functions
|
|
21
|
+
- Built-in actions: `reset`, `clear_output`, `show_values`, `to_dataframe`, `validate`
|
|
22
|
+
- Validation support
|
|
23
|
+
- Export values as dictionary, DataFrame, or JSON
|
|
24
|
+
- Layouts: `vertical`, `grid`, `horizontal`, `accordion`
|
|
25
|
+
- Works in Google Colab and Jupyter Notebook
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install frame2app
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For Google Colab:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
!pip install frame2app
|
|
37
|
+
from google.colab import output
|
|
38
|
+
output.enable_custom_widget_manager()
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Basic automatic usage
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import pandas as pd
|
|
45
|
+
from frame2app import AutoForm
|
|
46
|
+
|
|
47
|
+
sample_df = pd.DataFrame({
|
|
48
|
+
"age": [18, 25, 32, 45, 60],
|
|
49
|
+
"income": [20000, 35000, 50000, 70000, 90000],
|
|
50
|
+
"gender": ["Male", "Female", "Female", "Male", "Female"],
|
|
51
|
+
"city": ["London", "Dublin", "Paris", "London", "Berlin"],
|
|
52
|
+
"has_account": [True, False, True, True, False],
|
|
53
|
+
"target": [0, 1, 0, 1, 1]
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
def run_anything(values):
|
|
57
|
+
print("Values received:")
|
|
58
|
+
print(values)
|
|
59
|
+
|
|
60
|
+
app = AutoForm(
|
|
61
|
+
data=sample_df,
|
|
62
|
+
target="target",
|
|
63
|
+
title="Automatic GUI",
|
|
64
|
+
buttons={
|
|
65
|
+
"Run Anything": run_anything,
|
|
66
|
+
"Show Values": "show_values",
|
|
67
|
+
"As DataFrame": "to_dataframe",
|
|
68
|
+
"Reset": "reset",
|
|
69
|
+
"Clear Output": "clear_output",
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
app.display()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Hybrid automatic + customized fields
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
app = AutoForm(
|
|
80
|
+
data=sample_df,
|
|
81
|
+
target="target",
|
|
82
|
+
fields="auto",
|
|
83
|
+
overrides={
|
|
84
|
+
"age": {
|
|
85
|
+
"widget": "int_slider",
|
|
86
|
+
"min": 18,
|
|
87
|
+
"max": 100,
|
|
88
|
+
"step": 1,
|
|
89
|
+
"default": 30,
|
|
90
|
+
},
|
|
91
|
+
"gender": {
|
|
92
|
+
"widget": "radio",
|
|
93
|
+
"options": ["Male", "Female"],
|
|
94
|
+
"default": "Female",
|
|
95
|
+
},
|
|
96
|
+
"city": {
|
|
97
|
+
"widget": "combobox",
|
|
98
|
+
"options": ["London", "Dublin", "Paris", "Berlin", "New York"],
|
|
99
|
+
"default": "London",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
buttons={
|
|
103
|
+
"Submit": run_anything,
|
|
104
|
+
"Validate": "validate",
|
|
105
|
+
"Reset": "reset",
|
|
106
|
+
},
|
|
107
|
+
layout="grid",
|
|
108
|
+
title="Hybrid Auto + Custom GUI"
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
app.display()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Fully manual fields
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
app = AutoForm(
|
|
118
|
+
data=sample_df,
|
|
119
|
+
fields={
|
|
120
|
+
"age": {
|
|
121
|
+
"widget": "int_slider",
|
|
122
|
+
"min": 18,
|
|
123
|
+
"max": 100,
|
|
124
|
+
"default": 30,
|
|
125
|
+
"required": True,
|
|
126
|
+
},
|
|
127
|
+
"income": {
|
|
128
|
+
"widget": "int_text",
|
|
129
|
+
"default": 50000,
|
|
130
|
+
"validator": lambda value: (value >= 0, "Income must be non-negative."),
|
|
131
|
+
},
|
|
132
|
+
"gender": {
|
|
133
|
+
"widget": "dropdown",
|
|
134
|
+
"options": ["Male", "Female"],
|
|
135
|
+
"default": "Male",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
buttons={
|
|
139
|
+
"Process": run_anything,
|
|
140
|
+
"Reset": "reset",
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
app.display()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Supported widget names
|
|
148
|
+
|
|
149
|
+
- `int_slider`
|
|
150
|
+
- `float_slider`
|
|
151
|
+
- `range_slider`
|
|
152
|
+
- `float_range_slider`
|
|
153
|
+
- `int_text`
|
|
154
|
+
- `float_text`
|
|
155
|
+
- `dropdown`
|
|
156
|
+
- `combobox`
|
|
157
|
+
- `radio`
|
|
158
|
+
- `select_multiple`
|
|
159
|
+
- `checkbox`
|
|
160
|
+
- `textarea`
|
|
161
|
+
- `date_picker`
|
|
162
|
+
- `password`
|
|
163
|
+
- `file_upload`
|
|
164
|
+
- `text`
|
|
165
|
+
- `html`
|
|
166
|
+
|
|
167
|
+
## Built-in button actions
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
buttons={
|
|
171
|
+
"Show Values": "show_values",
|
|
172
|
+
"Show DataFrame": "to_dataframe",
|
|
173
|
+
"Validate": "validate",
|
|
174
|
+
"Reset": "reset",
|
|
175
|
+
"Clear Output": "clear_output",
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Custom button function
|
|
180
|
+
|
|
181
|
+
Every custom function receives the current form values as a dictionary.
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
def my_function(values):
|
|
185
|
+
print(values)
|
|
186
|
+
|
|
187
|
+
app = AutoForm(
|
|
188
|
+
data=sample_df,
|
|
189
|
+
buttons={"Run My Function": my_function}
|
|
190
|
+
)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Export values
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
values = app.get_values()
|
|
197
|
+
row_df = app.to_dataframe()
|
|
198
|
+
json_data = app.to_json()
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Local development
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pip install -e .
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Build
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pip install build twine
|
|
211
|
+
python -m build
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Publish
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
twine upload dist/*
|
|
218
|
+
```
|