| Name | ui-forge JSON |
| Version |
1.0.0
JSON |
| download |
| home_page | None |
| Summary | A WIP procedurally generated TUI made in NCurses using Python for CCSM |
| upload_time | 2024-10-26 17:21:15 |
| maintainer | None |
| docs_url | None |
| author | CJ Gilroy |
| requires_python | <4.0,>=3.12 |
| license | Unlicense |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Curses UI
An easy-to-use procedurally-generated widget system for curses in Python.
## dict_ui
Arguments:
- `base_window: curses.window` a curses window
- `dictionary: dict` a dictionary following a specific format. This is what the UI is generated from
- `item_display: Callable[[tuple[str, dict], bool], tuple[str, int]]` an optional keyword argument that allows users to overwrite the way items are listed
### dictionary format:
An "arg," from here on out, is a key-value pair, from within a dictionary, that is itself a value of a key-value pair from within the dictionary passed to `dict_ui`
A sub arg is an arg that is only passed with a certain functionality
#### global args
These arguments will be on *every* item listed here.
- `functionality: str` **required** - the functionality of the item, valid values will be covered later
- `description: str` - a description of the option
- `always_show_description: bool` - whether or not to always show the description of the item, if set to `False`, the description will only be shown while the item is selected.
#### functionalities
- `quit`
exits this instance of a menu. if selected in a sub menu it will return the user to the previous menu
- `run_function`
runs a function
sub args:
- `function: Callable[[Unknown], None]` - a reference to the function to run
- `args: list | tuple` - a list or tuple of positional arguments to pass to the function
- `kwargs: dict` - a dictionary of keyword arguments to pass to the function
- `edit`
opens the editor widget for an assigned value
sub args:
- `value: str` - the value assigned before editing - this gets overwritten after a successful edit
- `validator: Callable[[str], bool]` - a reference to a function. The input is the entire submitted string, and the output will determine whether or not it will get accepted. If it does not get accepted, the input box will be reset to the previous value, and the user will be prompted to input again. This will repeat until the uset inputs a valid value.
- `allowed_human_readable: str` - a string that gets printed after the name of the value the user is editing. This is intended to instruct users in an understandable fashion what values are valid or invalid.
- `select`
opens the selection widget
sub args:
- `value: str`
the value assigned before editing - this gets overwritten when the user selects a new value
- `options: dict`:
a dictionary containing dictionaries with the `option` functionality
- `option`
an option in a selection menu. Only intended to be used within the selection widget. The key is the value that will be selected.
- `sub menu`
a new instance of `dict_ui` with the input dictionary
sub args:
- `menu: dict`
a menu dictionary
## selection_ui
Arguments:
- `base_window: curses.window` - a curses window
- `options: dict` - a dictionary containing `option` items
- `item_display: Callable[[tuple[str, dict], bool], tuple[str, int]]` - an optional keyword argument that allows users to overwrite the way items are listed
## editor_ui
- `base_window: curses.window` - a curses window
- `name: str` - the "name" of the value being assigned, ususally analagous to the name of the variable being assigned to. This gets displayed to the user
- `value: str` - the default value before modification
- `validator: Callable[[str], bool]` - a reference to a function. The input is the entire submitted string, and the output will determine whether or not it will get accepted. If it does not get accepted, the input box will be reset to the previous value, and the user will be prompted to input again. This will repeat until the uset inputs a valid value.
- `allowed_human_readable: str` - a string that gets printed after the name of the value the user is editing. This is intended to instruct users in an understandable fashion what values are valid or invalid.
Raw data
{
"_id": null,
"home_page": null,
"name": "ui-forge",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "CJ Gilroy",
"author_email": "cjendantix@proton.me",
"download_url": "https://files.pythonhosted.org/packages/8c/2c/c2bc3153a21d93a8364bcc87984baa1ca9d7ec57a0ba2c92363c8ca25fd5/ui_forge-1.0.0.tar.gz",
"platform": null,
"description": "# Curses UI\nAn easy-to-use procedurally-generated widget system for curses in Python.\n\n## dict_ui\nArguments:\n- `base_window: curses.window` a curses window\n- `dictionary: dict` a dictionary following a specific format. This is what the UI is generated from\n- `item_display: Callable[[tuple[str, dict], bool], tuple[str, int]]` an optional keyword argument that allows users to overwrite the way items are listed\n\n### dictionary format:\nAn \"arg,\" from here on out, is a key-value pair, from within a dictionary, that is itself a value of a key-value pair from within the dictionary passed to `dict_ui`\n\nA sub arg is an arg that is only passed with a certain functionality\n\n#### global args\nThese arguments will be on *every* item listed here.\n- `functionality: str` **required** - the functionality of the item, valid values will be covered later\n- `description: str` - a description of the option\n- `always_show_description: bool` - whether or not to always show the description of the item, if set to `False`, the description will only be shown while the item is selected.\n\n#### functionalities\n- `quit`\n exits this instance of a menu. if selected in a sub menu it will return the user to the previous menu\n- `run_function`\n runs a function\n \n sub args:\n - `function: Callable[[Unknown], None]` - a reference to the function to run\n - `args: list | tuple` - a list or tuple of positional arguments to pass to the function\n - `kwargs: dict` - a dictionary of keyword arguments to pass to the function\n- `edit`\n opens the editor widget for an assigned value\n \n sub args:\n - `value: str` - the value assigned before editing - this gets overwritten after a successful edit\n - `validator: Callable[[str], bool]` - a reference to a function. The input is the entire submitted string, and the output will determine whether or not it will get accepted. If it does not get accepted, the input box will be reset to the previous value, and the user will be prompted to input again. This will repeat until the uset inputs a valid value.\n - `allowed_human_readable: str` - a string that gets printed after the name of the value the user is editing. This is intended to instruct users in an understandable fashion what values are valid or invalid.\n- `select`\n opens the selection widget\n\n sub args:\n - `value: str`\n the value assigned before editing - this gets overwritten when the user selects a new value\n - `options: dict`:\n a dictionary containing dictionaries with the `option` functionality\n- `option`\n an option in a selection menu. Only intended to be used within the selection widget. The key is the value that will be selected.\n- `sub menu`\n a new instance of `dict_ui` with the input dictionary\n\n sub args:\n - `menu: dict`\n a menu dictionary\n\n## selection_ui\nArguments:\n- `base_window: curses.window` - a curses window\n- `options: dict` - a dictionary containing `option` items\n- `item_display: Callable[[tuple[str, dict], bool], tuple[str, int]]` - an optional keyword argument that allows users to overwrite the way items are listed\n\n## editor_ui\n- `base_window: curses.window` - a curses window\n- `name: str` - the \"name\" of the value being assigned, ususally analagous to the name of the variable being assigned to. This gets displayed to the user\n- `value: str` - the default value before modification\n- `validator: Callable[[str], bool]` - a reference to a function. The input is the entire submitted string, and the output will determine whether or not it will get accepted. If it does not get accepted, the input box will be reset to the previous value, and the user will be prompted to input again. This will repeat until the uset inputs a valid value.\n- `allowed_human_readable: str` - a string that gets printed after the name of the value the user is editing. This is intended to instruct users in an understandable fashion what values are valid or invalid.\n",
"bugtrack_url": null,
"license": "Unlicense",
"summary": "A WIP procedurally generated TUI made in NCurses using Python for CCSM",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "305a01c8259cb8a234981b80c3a80279a7c34812be3f50a6edc44621403437c9",
"md5": "798e69c47495611879f9e09c9ee389c5",
"sha256": "667d5107f367c446656c5ebd16aca6fc8a862f28412471ef93bf5b9247d47252"
},
"downloads": -1,
"filename": "ui_forge-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "798e69c47495611879f9e09c9ee389c5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 6625,
"upload_time": "2024-10-26T17:21:14",
"upload_time_iso_8601": "2024-10-26T17:21:14.536664Z",
"url": "https://files.pythonhosted.org/packages/30/5a/01c8259cb8a234981b80c3a80279a7c34812be3f50a6edc44621403437c9/ui_forge-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8c2cc2bc3153a21d93a8364bcc87984baa1ca9d7ec57a0ba2c92363c8ca25fd5",
"md5": "3547d07d6e3034163b23c7277bf6ac5a",
"sha256": "2b0ed0c59d082126bbdb2b0768d059142910c3a7c588a278985875b9b51f8394"
},
"downloads": -1,
"filename": "ui_forge-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "3547d07d6e3034163b23c7277bf6ac5a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 5138,
"upload_time": "2024-10-26T17:21:15",
"upload_time_iso_8601": "2024-10-26T17:21:15.545908Z",
"url": "https://files.pythonhosted.org/packages/8c/2c/c2bc3153a21d93a8364bcc87984baa1ca9d7ec57a0ba2c92363c8ca25fd5/ui_forge-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-26 17:21:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ui-forge"
}