paramify 0.1.4__tar.gz → 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.
- {paramify-0.1.4 → paramify-0.2.0}/LICENSE +21 -21
- paramify-0.2.0/MANIFEST.in +4 -0
- paramify-0.2.0/PKG-INFO +377 -0
- paramify-0.2.0/README.md +322 -0
- {paramify-0.1.4 → paramify-0.2.0}/examples/__pycache__/logger.cpython-312.pyc +0 -0
- {paramify-0.1.4 → paramify-0.2.0}/examples/config.json +59 -59
- paramify-0.2.0/examples/config.yaml +61 -0
- paramify-0.2.0/examples/config_camera.yaml +24 -0
- paramify-0.2.0/examples/config_groups.yaml +72 -0
- {paramify-0.1.4 → paramify-0.2.0}/examples/logger.py +65 -65
- {paramify-0.1.4 → paramify-0.2.0}/examples/simple_params.py +33 -33
- paramify-0.2.0/examples/simple_params_groups.py +84 -0
- {paramify-0.1.4 → paramify-0.2.0}/examples/simple_params_web.py +36 -36
- paramify-0.2.0/pyproject.toml +68 -0
- {paramify-0.1.4 → paramify-0.2.0}/setup.cfg +4 -4
- paramify-0.2.0/src/paramify/__init__.py +6 -0
- paramify-0.2.0/src/paramify/core.py +577 -0
- paramify-0.2.0/src/paramify/web.py +114 -0
- paramify-0.2.0/src/paramify.egg-info/PKG-INFO +377 -0
- paramify-0.2.0/src/paramify.egg-info/SOURCES.txt +33 -0
- paramify-0.2.0/src/paramify.egg-info/requires.txt +9 -0
- {paramify-0.1.4 → paramify-0.2.0/src}/paramify.egg-info/top_level.txt +0 -1
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_callback.py +60 -60
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_cli.py +47 -47
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_dynamic.py +64 -64
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_init.py +88 -88
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_misc.py +61 -61
- paramify-0.2.0/tests/test_paramify_new_features.py +549 -0
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_performance.py +95 -95
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_persist.py +80 -80
- {paramify-0.1.4 → paramify-0.2.0}/tests/test_paramify_validation.py +61 -61
- paramify-0.1.4/MANIFEST.in +0 -4
- paramify-0.1.4/PKG-INFO +0 -281
- paramify-0.1.4/README.md +0 -240
- paramify-0.1.4/examples/config.yaml +0 -62
- paramify-0.1.4/paramify/__init__.py +0 -0
- paramify-0.1.4/paramify/paramify.py +0 -258
- paramify-0.1.4/paramify/paramify_web.py +0 -106
- paramify-0.1.4/paramify.egg-info/PKG-INFO +0 -281
- paramify-0.1.4/paramify.egg-info/SOURCES.txt +0 -30
- paramify-0.1.4/paramify.egg-info/requires.txt +0 -3
- paramify-0.1.4/setup.py +0 -45
- paramify-0.1.4/tests/__init__.py +0 -0
- {paramify-0.1.4 → paramify-0.2.0/src}/paramify/static/assets/index-C3Xrcbp_.js +0 -0
- {paramify-0.1.4 → paramify-0.2.0/src}/paramify/static/assets/index-DwXyNpx-.css +0 -0
- {paramify-0.1.4 → paramify-0.2.0/src}/paramify/static/index.html +0 -0
- {paramify-0.1.4 → paramify-0.2.0/src}/paramify.egg-info/dependency_links.txt +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 LuxAI S.A.
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 LuxAI S.A.
|
|
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.
|
paramify-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paramify
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A lightweight Python library for dynamic parameter management and runtime configuration.
|
|
5
|
+
Author-email: Ali PAikan <ali.paikan@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 LuxAI S.A.
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/luxai-qtrobot/paramify
|
|
29
|
+
Project-URL: Documentation, https://github.com/luxai-qtrobot/paramify#readme
|
|
30
|
+
Project-URL: Source, https://github.com/luxai-qtrobot/paramify
|
|
31
|
+
Project-URL: Bug Tracker, https://github.com/luxai-qtrobot/paramify/issues
|
|
32
|
+
Keywords: parameter,management,configuration,dynamic,runtime,UI
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
43
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
44
|
+
Requires-Python: >=3.7
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: ruamel.yaml>=0.17.0
|
|
48
|
+
Provides-Extra: web
|
|
49
|
+
Requires-Dist: bottle>=0.12; extra == "web"
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: bottle>=0.12; extra == "dev"
|
|
52
|
+
Requires-Dist: pytest; extra == "dev"
|
|
53
|
+
Requires-Dist: coverage; extra == "dev"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Paramify
|
|
58
|
+
|
|
59
|
+

|
|
60
|
+
|
|
61
|
+
**Paramify** is a lightweight Python library for dynamic parameter management. Define, validate, and manage parameters from a YAML or JSON schema with optional CLI integration and a web-based configuration UI.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Key Features
|
|
66
|
+
|
|
67
|
+
- **Dynamic Parameter Management** — define parameters in YAML/JSON or as plain Python dicts
|
|
68
|
+
- **Groups & Nesting** — organise parameters hierarchically with `type: group`
|
|
69
|
+
- **YAML Includes** — split large configs across multiple files with `include:`
|
|
70
|
+
- **Typed Lists** — `list[bool]`, `list[int]`, `list[float]`, `list[double]`, `list[str]`, `list[string]`
|
|
71
|
+
- **C++-compatible type names** — `double` (alias for `float`) and `string` (alias for `str`)
|
|
72
|
+
- **`value:` keyword** — preferred over `default:` for setting parameter values (both accepted)
|
|
73
|
+
- **Scope-Based Control** — `scope: all | cli | runtime`; `runtime` params are never exposed to CLI
|
|
74
|
+
- **CLI Integration** — auto-generate CLI arguments from the schema; bool params get `--flag` / `--no-flag`
|
|
75
|
+
- **Custom Callbacks** — `on_<param>_set(self, value)` triggered on every update
|
|
76
|
+
- **Persistence** — changes written back to the source YAML/JSON file automatically
|
|
77
|
+
- **`save_as(path)`** — export current state to a new YAML file
|
|
78
|
+
- **Web Interface** — optional Bottle-based UI for runtime configuration (`pip install paramify[web]`)
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Core (parameter management + CLI)
|
|
88
|
+
pip install paramify
|
|
89
|
+
|
|
90
|
+
# With web interface
|
|
91
|
+
pip install paramify[web]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Quick Start
|
|
97
|
+
|
|
98
|
+
### Basic usage
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from paramify import Paramify
|
|
102
|
+
|
|
103
|
+
class MyApp(Paramify):
|
|
104
|
+
def on_speed_set(self, value):
|
|
105
|
+
print(f"speed updated to {value}")
|
|
106
|
+
|
|
107
|
+
params = {
|
|
108
|
+
"parameters": [
|
|
109
|
+
{"name": "enabled", "type": "bool", "default": True},
|
|
110
|
+
{"name": "speed", "type": "int", "default": 10},
|
|
111
|
+
{"name": "label", "type": "string", "default": "robot"},
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
app = MyApp(params, enable_cli=False)
|
|
116
|
+
print(app.parameters.enabled) # True
|
|
117
|
+
print(app.parameters.speed) # 10
|
|
118
|
+
|
|
119
|
+
app.set_speed(42) # triggers on_speed_set
|
|
120
|
+
print(app.get_parameters()) # {'enabled': True, 'speed': 42, 'label': 'robot'}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Groups and nested parameters
|
|
124
|
+
|
|
125
|
+
Parameters can be organised into groups. Nested params are accessed with dot notation
|
|
126
|
+
(`params.camera.enabled`) and their setters/callbacks use underscores (`set_camera_enabled`,
|
|
127
|
+
`on_camera_enabled_set`).
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
# config.yaml
|
|
131
|
+
name: "My Robot App"
|
|
132
|
+
parameters:
|
|
133
|
+
|
|
134
|
+
- name: "enabled"
|
|
135
|
+
type: "bool"
|
|
136
|
+
value: true
|
|
137
|
+
scope: "all"
|
|
138
|
+
|
|
139
|
+
- name: "camera"
|
|
140
|
+
type: "group"
|
|
141
|
+
parameters:
|
|
142
|
+
- name: "enabled"
|
|
143
|
+
type: "bool"
|
|
144
|
+
value: true
|
|
145
|
+
- name: "fps"
|
|
146
|
+
type: "int"
|
|
147
|
+
value: 30
|
|
148
|
+
- name: "gain"
|
|
149
|
+
type: "double" # alias for float
|
|
150
|
+
value: 1.0
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from paramify import Paramify
|
|
155
|
+
|
|
156
|
+
class MyApp(Paramify):
|
|
157
|
+
def on_camera_enabled_set(self, value): # dots → underscores
|
|
158
|
+
print(f"camera.enabled → {value}")
|
|
159
|
+
|
|
160
|
+
app = MyApp("config.yaml")
|
|
161
|
+
|
|
162
|
+
print(app.parameters.camera.enabled) # True
|
|
163
|
+
print(app.parameters.camera.fps) # 30
|
|
164
|
+
|
|
165
|
+
app.set_camera_enabled(False) # triggers callback + saves file
|
|
166
|
+
app.set_camera_gain(2.5)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### YAML includes
|
|
170
|
+
|
|
171
|
+
Large configs can be split across files. Use `include:` inside a group to load parameters
|
|
172
|
+
from one or more external YAML files.
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
# main.yaml
|
|
176
|
+
parameters:
|
|
177
|
+
- name: "camera"
|
|
178
|
+
type: "group"
|
|
179
|
+
include: "camera_params.yaml" # single file
|
|
180
|
+
|
|
181
|
+
- name: "audio"
|
|
182
|
+
type: "group"
|
|
183
|
+
include: # list of files
|
|
184
|
+
- "audio_base.yaml"
|
|
185
|
+
- "audio_advanced.yaml"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
# camera_params.yaml
|
|
190
|
+
parameters:
|
|
191
|
+
- name: "enabled"
|
|
192
|
+
type: "bool"
|
|
193
|
+
value: true
|
|
194
|
+
- name: "resolution"
|
|
195
|
+
type: "string"
|
|
196
|
+
value: "1080p"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Included files are saved independently when their parameters change. Circular includes are
|
|
200
|
+
detected and raise a `ValueError`.
|
|
201
|
+
|
|
202
|
+
### Typed lists
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
parameters:
|
|
206
|
+
- name: "channels"
|
|
207
|
+
type: "list[int]"
|
|
208
|
+
value: [1, 2]
|
|
209
|
+
|
|
210
|
+
- name: "labels"
|
|
211
|
+
type: "list[string]"
|
|
212
|
+
value: ["cat", "dog"]
|
|
213
|
+
|
|
214
|
+
- name: "weights"
|
|
215
|
+
type: "list[double]"
|
|
216
|
+
value: [0.1, 0.9]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Supported list types: `list[bool]`, `list[int]`, `list[float]`, `list[double]`,
|
|
220
|
+
`list[str]`, `list[string]`, and untyped `list`.
|
|
221
|
+
|
|
222
|
+
### `value:` vs `default:`
|
|
223
|
+
|
|
224
|
+
Both keywords are accepted. `value:` takes precedence if both are present (matches
|
|
225
|
+
paramify-cpp behaviour).
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
- name: "gain"
|
|
229
|
+
type: "double"
|
|
230
|
+
value: 2.0 # preferred
|
|
231
|
+
default: 1.0 # fallback if value: is absent
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Scope
|
|
235
|
+
|
|
236
|
+
| Scope | CLI | Runtime |
|
|
237
|
+
|-------|-----|---------|
|
|
238
|
+
| `all` (default) | ✅ | ✅ |
|
|
239
|
+
| `cli` | ✅ | ❌ |
|
|
240
|
+
| `runtime` | ❌ | ✅ |
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
- name: "debug"
|
|
244
|
+
type: "bool"
|
|
245
|
+
value: false
|
|
246
|
+
scope: "runtime" # never shown in --help, never parsed from argv
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `save_as`
|
|
250
|
+
|
|
251
|
+
Export the current parameter state to a new YAML file:
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
app.save_as("/tmp/config_snapshot.yaml")
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## YAML Configuration Reference
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
name: "My App" # optional app name
|
|
263
|
+
description: "..." # optional description shown in --help
|
|
264
|
+
|
|
265
|
+
parameters:
|
|
266
|
+
|
|
267
|
+
# Scalar types
|
|
268
|
+
- name: "flag"
|
|
269
|
+
type: "bool" # bool | int | float | double | str | string
|
|
270
|
+
value: true # 'value:' preferred; 'default:' also accepted
|
|
271
|
+
scope: "all" # all | cli | runtime (default: all)
|
|
272
|
+
label: "Enable flag" # display label (used in web UI)
|
|
273
|
+
description: "..." # shown in --help
|
|
274
|
+
|
|
275
|
+
# Typed list
|
|
276
|
+
- name: "ids"
|
|
277
|
+
type: "list[int]" # list[bool|int|float|double|str|string] or plain list
|
|
278
|
+
value: [1, 2, 3]
|
|
279
|
+
|
|
280
|
+
# Inline group
|
|
281
|
+
- name: "camera"
|
|
282
|
+
type: "group"
|
|
283
|
+
parameters:
|
|
284
|
+
- name: "enabled"
|
|
285
|
+
type: "bool"
|
|
286
|
+
value: true
|
|
287
|
+
- name: "fps"
|
|
288
|
+
type: "int"
|
|
289
|
+
value: 30
|
|
290
|
+
|
|
291
|
+
# Group loaded from external file(s)
|
|
292
|
+
- name: "audio"
|
|
293
|
+
type: "group"
|
|
294
|
+
include: "audio_params.yaml" # string or list of strings
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## JSON Configuration
|
|
300
|
+
|
|
301
|
+
JSON configs support all scalar types and typed lists but **not** `type: group` or
|
|
302
|
+
`include:`. Use `"default"` as the value key in JSON.
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"name": "My App",
|
|
307
|
+
"parameters": [
|
|
308
|
+
{"name": "enabled", "type": "bool", "default": true},
|
|
309
|
+
{"name": "speed", "type": "int", "default": 10},
|
|
310
|
+
{"name": "labels", "type": "list[string]", "default": ["a", "b"]}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## CLI Integration
|
|
318
|
+
|
|
319
|
+
Parameters with `scope: all` or `scope: cli` are automatically exposed as CLI arguments.
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
python my_app.py --speed 99 --camera-enabled --no-camera-mute
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
- Dot-notation keys become kebab-case flags: `camera.enabled` → `--camera-enabled`
|
|
326
|
+
- Bool params get both `--flag` and `--no-flag`
|
|
327
|
+
- List params accept multiple values: `--channels 1 2 3`
|
|
328
|
+
- CLI values override file defaults but are **not** persisted
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Web Interface
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
pip install paramify[web]
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
```python
|
|
339
|
+
from paramify.web import ParamifyWeb
|
|
340
|
+
|
|
341
|
+
class MyApp(ParamifyWeb):
|
|
342
|
+
def on_speed_set(self, value):
|
|
343
|
+
print(f"speed → {value}")
|
|
344
|
+
|
|
345
|
+
app = MyApp("config.yaml", host="0.0.0.0", port=5000)
|
|
346
|
+
input("Press Enter to stop...")
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Open `http://localhost:5000` to adjust parameters in the browser. All groups (including
|
|
350
|
+
those loaded via `include:`) appear as a flat list in the UI.
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Callbacks and Setters
|
|
355
|
+
|
|
356
|
+
For a parameter with key `camera.enabled`:
|
|
357
|
+
|
|
358
|
+
| What | Name |
|
|
359
|
+
|------|------|
|
|
360
|
+
| Setter method | `set_camera_enabled(value)` |
|
|
361
|
+
| Callback method | `on_camera_enabled_set(self, value)` |
|
|
362
|
+
| Namespace access | `app.parameters.camera.enabled` |
|
|
363
|
+
| Dict access | `app.get_parameters()["camera.enabled"]` |
|
|
364
|
+
|
|
365
|
+
Dots in parameter keys are replaced by underscores in method names.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Contributing
|
|
370
|
+
|
|
371
|
+
Contributions are welcome! Feel free to open issues or submit pull requests.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## License
|
|
376
|
+
|
|
377
|
+
This project is licensed under the MIT License. See the `LICENSE` file for details.
|