# OpenTEA

OpenTEA is a graphical user interface engine. It convert a set of degrees of freedom, expressed in SCHEMA, into graphical forms.

The documentation is currently available in [ReadtheDocs](https://opentea.readthedocs.io/en/latest/)
## Installation
Opentea is OpenSource (Cecill-B) available on PiPY.
```bash
>pip install opentea
```
then test your installation with
```bash
>opentea3 test-gui trivial
```
## Basic Usage
OpenTEA is a GUI engine, based on the json-SCHEMA description. For example, assume a nested information conforming to the following SCHEMA :
```yaml
---
title: "Trivial form..."
type: object
properties:
first_tab:
type: object
title: Only tab.
process: custom_callback.py
properties:
first_block:
type: object
title: Custom Block
properties:
number_1:
title: "Number 1"
type: number
default: 32.
operand:
title: "Operation"
type: string
default: "+"
enum: ["+", "-", "*", "/"]
number_2:
title: "Number 2"
type: number
default: 10.
result:
title: "result"
state: disabled
type: string
default: "-"
```
The openTEA GUI will show as :

In this form, a callback can be added to each tab.
The corresponding `custom_callback.py` script is :
```python
"""Module for the first tab."""
from opentea.process_utils import process_tab
def custom_fun(nob):
"""Update the result."""
operation = nob["first_tab"]["first_block"]["operand"]
nb1 = nob["first_tab"]["first_block"]["number_1"]
nb2 = nob["first_tab"]["first_block"]["number_2"]
res = None
if operation == "+":
res = nb1 + nb2
elif operation == "-":
res = nb1 - nb2
elif operation == "*":
res = nb1 * nb2
elif operation == "/":
res = nb1 / nb2
else:
res = None
nob["first_tab"]["first_block"]["result"] = res
return nob
if __name__ == "__main__":
process_tab(custom_fun)
```
Note that OpenTEA meomory is a classical nested object named here `nob`. The memory I/O can be done the usual Python way : `nob["first_tab"]["first_block"]["result"] = res`.
*We however encourage the use our nested object helper , available on PyPI, which gives a faster -an still pythonic- access to the nested object. The name of the package is, unsurprisigly [nob](https://pypi.org/project/nob/).*
Finally, the data recorded by the GUI is available as a YAML file, conforming to the SCHEMA Validation:
```yaml
first_tab:
first_block:
number_1: 32.0
number_2: 10.0
operand: +
result: 42.0
```
# Command line
A small CLI makes available small tools for developpers. Only two tools are present now.
Call the CLI using `opentea3`:
```bash
Usage: opentea3 [OPTIONS] COMMAND [ARGS]...
--------------- O P E N T E A III --------------------
You are now using the Command line interface of Opentea 3, a Python3
Tkinter GUI engine based on SCHEMA specifications, created at CERFACS
(https://cerfacs.fr).
This is a python package currently installed in your python environement.
See the full documentation at : https://opentea.readthedocs.io/en/latest/.
Options:
--help Show this message and exit.
Commands:
test-gui Examples of OpenTEA GUIs
test-schema Test if a yaml SCHEMA_FILE is valid for an opentea GUI.
```
# Acknowledgments
This work was funded, among many sources, by the CoE [Excellerat](https://www.excellerat.eu/wp/) and the National project [ICARUS](http://cerfacs.fr/coop/whatwedo/ourprojects/). Many thanks to the people from SAFRAN group for their feedback.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/cerfacs/opentea3",
"name": "OpenTEA",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "GUI, SCHEMA, Tkinter",
"author": "Antoine Dauptain, Aimad Er-raiy, L. F. Pereira",
"author_email": "coop@cerfacs.com",
"download_url": "https://files.pythonhosted.org/packages/1f/61/54eec53feb7ed9f16fff4a2c8e1bc5fafa1d48f03486583e70788eff6561/OpenTEA-3.7.0.tar.gz",
"platform": null,
"description": "# OpenTEA\n\n\n\nOpenTEA is a graphical user interface engine. It convert a set of degrees of freedom, expressed in SCHEMA, into graphical forms.\n\n\n\nThe documentation is currently available in [ReadtheDocs](https://opentea.readthedocs.io/en/latest/)\n\n\n## Installation \n\nOpentea is OpenSource (Cecill-B) available on PiPY. \n\n```bash\n>pip install opentea\n```\n\nthen test your installation with\n\n```bash\n>opentea3 test-gui trivial\n```\n\n## Basic Usage\n\nOpenTEA is a GUI engine, based on the json-SCHEMA description. For example, assume a nested information conforming to the following SCHEMA :\n\n```yaml\n---\ntitle: \"Trivial form...\"\ntype: object\nproperties:\n first_tab:\n type: object\n title: Only tab.\n process: custom_callback.py\n properties:\n first_block:\n type: object\n title: Custom Block\n properties:\n number_1:\n title: \"Number 1\"\n type: number\n default: 32.\n operand:\n title: \"Operation\"\n type: string\n default: \"+\"\n enum: [\"+\", \"-\", \"*\", \"/\"]\n number_2:\n title: \"Number 2\"\n type: number\n default: 10.\n result:\n title: \"result\"\n state: disabled\n type: string\n default: \"-\"\n```\n\nThe openTEA GUI will show as :\n\n\n\nIn this form, a callback can be added to each tab.\nThe corresponding `custom_callback.py` script is :\n\n```python\n\"\"\"Module for the first tab.\"\"\"\n\nfrom opentea.process_utils import process_tab\n\ndef custom_fun(nob):\n \"\"\"Update the result.\"\"\"\n\n operation = nob[\"first_tab\"][\"first_block\"][\"operand\"]\n nb1 = nob[\"first_tab\"][\"first_block\"][\"number_1\"]\n nb2 = nob[\"first_tab\"][\"first_block\"][\"number_2\"]\n\n res = None\n if operation == \"+\":\n res = nb1 + nb2\n elif operation == \"-\":\n res = nb1 - nb2\n elif operation == \"*\":\n res = nb1 * nb2\n elif operation == \"/\":\n res = nb1 / nb2\n else:\n res = None\n\n nob[\"first_tab\"][\"first_block\"][\"result\"] = res\n return nob\n\nif __name__ == \"__main__\":\n process_tab(custom_fun)\n```\n\nNote that OpenTEA meomory is a classical nested object named here `nob`. The memory I/O can be done the usual Python way : `nob[\"first_tab\"][\"first_block\"][\"result\"] = res`.\n*We however encourage the use our nested object helper , available on PyPI, which gives a faster -an still pythonic- access to the nested object. The name of the package is, unsurprisigly [nob](https://pypi.org/project/nob/).*\n\n\nFinally, the data recorded by the GUI is available as a YAML file, conforming to the SCHEMA Validation:\n\n```yaml\nfirst_tab:\n first_block:\n number_1: 32.0\n number_2: 10.0\n operand: +\n result: 42.0\n```\n\n# Command line\n\nA small CLI makes available small tools for developpers. Only two tools are present now.\nCall the CLI using `opentea3`:\n\n```bash\nUsage: opentea3 [OPTIONS] COMMAND [ARGS]...\n\n --------------- O P E N T E A III --------------------\n\n You are now using the Command line interface of Opentea 3, a Python3\n Tkinter GUI engine based on SCHEMA specifications, created at CERFACS\n (https://cerfacs.fr).\n\n This is a python package currently installed in your python environement.\n See the full documentation at : https://opentea.readthedocs.io/en/latest/.\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n test-gui Examples of OpenTEA GUIs\n test-schema Test if a yaml SCHEMA_FILE is valid for an opentea GUI.\n```\n\n# Acknowledgments\n\nThis work was funded, among many sources, by the CoE [Excellerat](https://www.excellerat.eu/wp/) and the National project [ICARUS](http://cerfacs.fr/coop/whatwedo/ourprojects/). Many thanks to the people from SAFRAN group for their feedback. \n",
"bugtrack_url": null,
"license": null,
"summary": "Graphical User Interface engine based upon Schema",
"version": "3.7.0",
"project_urls": {
"Bug Tracker": "https://gitlab.com/cerfacs/opentea3/-/issues",
"Documentation": "https://opentea.readthedocs.io/en/latest/",
"Homepage": "https://gitlab.com/cerfacs/opentea3"
},
"split_keywords": [
"gui",
" schema",
" tkinter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe56021b56e85283f0e004a943063ed8c83c781e4c7fa1a0eeedc00cd9803360",
"md5": "82e25b222f07ec7ca41c7e966a699f67",
"sha256": "3ddf2e603694fc9ca9278659f1a5925269e03708445e6e5225d071eda36a2a42"
},
"downloads": -1,
"filename": "OpenTEA-3.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "82e25b222f07ec7ca41c7e966a699f67",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 484494,
"upload_time": "2024-11-22T10:38:57",
"upload_time_iso_8601": "2024-11-22T10:38:57.320767Z",
"url": "https://files.pythonhosted.org/packages/fe/56/021b56e85283f0e004a943063ed8c83c781e4c7fa1a0eeedc00cd9803360/OpenTEA-3.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f6154eec53feb7ed9f16fff4a2c8e1bc5fafa1d48f03486583e70788eff6561",
"md5": "531f0531be8263a2ce36efabe4e862c8",
"sha256": "bf0195072c1c586e0243a36247f3ca673b9e26680f96b177a82fdb650ec472cd"
},
"downloads": -1,
"filename": "OpenTEA-3.7.0.tar.gz",
"has_sig": false,
"md5_digest": "531f0531be8263a2ce36efabe4e862c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 459362,
"upload_time": "2024-11-22T10:38:59",
"upload_time_iso_8601": "2024-11-22T10:38:59.350113Z",
"url": "https://files.pythonhosted.org/packages/1f/61/54eec53feb7ed9f16fff4a2c8e1bc5fafa1d48f03486583e70788eff6561/OpenTEA-3.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 10:38:59",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "cerfacs",
"gitlab_project": "opentea3",
"lcname": "opentea"
}