configwebui-lucien


Nameconfigwebui-lucien JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryA simple web-based configuration editor for Python applications.
upload_time2025-07-28 07:24:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords configuration editor web tool json yaml ui flask
VCS
bugtrack_url
requirements Flask jsonschema
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyConfigWebUI

[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lucienshawls/py-config-web-ui)
[![Build Status](https://github.com/lucienshawls/py-config-web-ui/actions/workflows/release.yml/badge.svg)](https://github.com/lucienshawls/py-config-web-ui/actions/workflows/release.yml)
[![License](https://img.shields.io/github/license/lucienshawls/py-config-web-ui)](LICENSE)
[![Latest Release Tag](https://img.shields.io/github/v/release/lucienshawls/py-config-web-ui)](https://github.com/lucienshawls/py-config-web-ui/releases/latest)
[![Latest PyPI Version](https://img.shields.io/pypi/v/configwebui-lucien.svg)](https://pypi.org/project/configwebui-lucien/)

A simple web-based configuration editor for Python applications.

This package provides tools for editing configuration files
in a user-friendly web interface.

Package on PyPI: [configwebui-lucien · PyPI](https://pypi.org/project/configwebui-lucien/)
## What It Does

**ConfigWebUI** is a lightweight and intuitive web-based configuration editor designed for Python applications. It allows developers to quickly generate user-friendly configuration interfaces from JSON schemas, enabling seamless configuration management without requiring users to understand the underlying file syntax.

### Features

- **Generate Configuration Interfaces Easily**: Provide a JSON schema, and ConfigWebUI generates a complete UI for configuration management.
- **Support for Profiles**: Manage multiple configuration profiles for the same schema. Easily switch between profiles without editing configurations each time.
- **Validation with Schema and Custom Logic**: The package validates configurations against the schema as users edit, ensuring data accuracy, and developers can specify additional backend validation to suit specific requirements.
- **Asynchronous Processing**: Supports asynchronous program execution with real-time status updates.
- **Interactive Terminal Output**: View and manage real-time program logs directly in the web UI.
- **Non-intrusive Integration**: Easily integrates into existing Python projects without interfering with their core functionality. The tool operates independently and does not alter the program's behavior unless explicitly used.
- **Seamless Fallback**: After applying this tool, your program can still run normally even if the web-based interface is not accessed. This ensures uninterrupted functionality in all scenarios.

### Screenshots
- Automatically generate a web interface with only a schema
![A General Web Interface that allows users to edit configurations](docs/general.png)
- Edit different profiles of different configs with ease
![Users are allowed to edit different profiles of different configs and save configs](docs/save.png)
- Run the main program and see the terminal output here
![Running main program and show the terminal output](docs/run.png)

## Try it out
To get an intuitive understanding of how to use this tool, you can do the following:

1. Clone this repository
    ```shell
    git clone https://github.com/lucienshawls/py-config-web-ui
    cd ./py-config-web-ui
    ```

2. Install dependencies in a virtual environment or a conda environment to avoid conflicts (or not).
    ```shell
    pip install -r ./requirements.txt
    ```

3. Run demo!
    ```shell
    python ./demo/demo_ui.py
    ```

4. Switch to your web browser

    If your browser does not pop up, visit the link that shows in your terminal.

5. Edit and save any config
6. See if your config has been saved to `./demo/config`
7. Click `Launch main program` (a submenu from `Save` in the navigation bar) and checkout the terminal output

    It should run `./demo/demo_main.py` and display some messages based on the config, just like running that Python file from the terminal.

## Architecture
As you see from the demo: with this package, your application can automatically generate a full-featured configuration editor UI from a schema. Here's how the architecture breaks down:

```
Config Schema --(defined in)--> UserConfig --(included in)--> ConfigEditor --(features)--> Local Web UI
```

### 0. Data Format
Developers can use `json`, `yaml`, `toml`, or any configuration format; just convert it to a Python `dict` when passing data into the system.

Internally, everything works with plain `dict` objects: the package requires only a `dict` on input and returns a `dict` on output.

That means, developers never need to worry about parsing or formatting when interacting with this package; just read your config from whatever source, supply it as a `dict`, and receive a `dict` back when saving.

### 1. Schema Input
Write a schema that defines the structure, defaults, types, and validation rules for each of your config. This schema becomes the single source of truth for generating the entire editor interface.

Learn more about schemas: [Json Schema](https://json-schema.org/)

### 2. UserConfig - Config Instance Wrapper
Each config schema and its corresponding config data are wrapped inside a `UserConfig` object. This class:

- Provides the schema for UI rendering;

- Validates user inputs based on the schema (including required fields, types, ranges, enums, etc.);

- Manages several profiles (they are based on the same schema; each stores an independent configuration);

- Connects to a developer-defined validation function for custom validations (aside from schema-based validations);

- Connects to a developer-defined save function to save configurations;

This modular design allows developers to manage multiple independent configurations within a single application.

### 3. ConfigEditor - Main Web UI Controller
The ConfigEditor is the application's core orchestrator. It:

Starts a local HTTP server to serve the web interface.

Manages one or more UserConfig instances.

Automatically generates interactive UI forms from each schema.

Handles the UI-to-backend workflows: loading configuration data, saving updates, and invoking actions like running scripts.

## Use it in your own project
### 1. Installation
Activate the python environment of your own project, and choose one of the installation methods:
1. Online installation from PyPI
```shell
pip install configwebui-lucien
```
2. Offline installtion from Github release

Download the `.whl` file from the [Latest Release](https://github.com/lucienshawls/py-config-web-ui/releases/latest). Install this using pip.

3. Make your own build
```shell
pip install setuptools setuptools-scm wheel build
python -m build -n --sdist --wheel
```
Then you can get the `.whl` file from `./dist/`. Install this using pip.

### 2. Import

In your python file, import this package:
```python
from configwebui import ConfigEditor, UserConfig, ResultStatus
```
or:

```python
from configwebui import *
```

They have exactly the same effect.

### 3. Integration
1. Preparation

    Generally, for each configuration, you will need:
    - `schema` of type `dict`
    - `extra_validation_function` which is `Callable`
    - `save function` which is `Callable`

    Additionally, you will need:
    - `main_entry_point` which is `Callable`

    In Detail:
    - Set up a function that verifies the config

        When user clicks the `Save` button on the webpage, the config will first pass the extra validations before it can be saved to the memory. You can set up your own validation function.

        Your function should take two positional arguments:
        - `name` of type `str`
        - `config` of type `dict` or `None`

        Your function should return a `ResultStatus` object or a `boolean` value. 

        If you choose the former, you can attach several error messages that the user can see on the webpage. For example, instantiate a `ResultStatus` object and set the messages:

        ```python
        from configwebui import *


        # True indicates a success
        res1 = ResultStatus(True, "Success!")

        # False indicates a failure
        res2 = ResultStatus(False, ["Failed!", "Incorrect format"])  # Message lists are also supported

        # Alternatively, you can also instantiate a ResultStatus object with no messages, and add messages or change status later.
        res3 = ResultStatus(True)
        res3.set_status(False)
        res3.add_message("message 1")
        ```

        This validation function is related to a specific `UserConfig` that you set up later.

        Example:
        ```python
        from configwebui import *


        def always_pass(
            config_name: str,
            config: dict | None,
        ) -> ResultStatus:
            # Instantiate a ResultStatus object with no messages, and set its status to True.
            res = ResultStatus(True)
            if False:
                # Just to show what to do when validation fails
                res.set_status(False)
                res.add_message("message 1")
                res.add_message("message 2")

            return res
        ```

    - Set up a function that saves config

        When user clicks the `Save` button on the webpage, and after the config passes extra validations, the config is saved to the memory immediately and your save function is then called in a separate thread.

        You can choose not to set the save function; however, if you do so, all edited configurations will only remain in memory and cannot be read, and will disappear when the program is restarted.

        Your function should take three positional arguments:
        - `user_config_name` of type `str`
        - `profile_name` of type `str`
        - `config` of type `dict`

        Parameter validation is not needed. It is guaranteed that the parameters satisfy your requirements.

        Return values are not needed either, because for now, the package does not read the result.

        This function is related to a specific `UserConfig` that you set up later.

        Example:
        ```python
        import json
        import os

        from configwebui import *


        def my_save(user_config_name: str, profile_name: str, config: dict):
            # You don't need to perform parameter validation
            os.makedirs(f"./config/{user_config_name}", exist_ok=True)
            with open(
                f"./config/{user_config_name}/{profile_name}.json", "w", encoding="utf-8"
            ) as f:
                json.dump(config, f, indent=4)
            print(config)
        ```

    - Set up a main entry point

        When user clicks `Launch main program` button on the webpage, your save function is called in a separate thread.

        Your function should take no positional arguments.

        Return values are not needed.

        This function is related to a specific `ConfigEditor` that you set up later.

        ATTENTION: Your main entry should be treated as an independent program that independently obtains configurations from the location where the configuration file is saved, and executes the code. Therefore, when the main entry is called, configuration-related parameters will not be passed in.

        Example:
        ```python
        import json
        import os


        def my_main_entry():
            print("======== This is main entry =======")
            if os.path.exists("config/myconfig.json"):
                with open("config/myconfig.json", "r", encoding="utf-8") as f:
                    config = json.load(f)
                print(config)
        ```

2. Fire it up

    Instantiate a `ConfigEditor` object, and add one or more `UserConfig`s to it:
    ```python
    import os

    from configwebui import *


    schema = {
        "title": "Example Schema",
        "type": "object",
        "properties": {
            "name": {"type": "string", "title": "Name"},
            "age": {"type": "integer", "title": "Age"},
            "is_student": {"type": "boolean"},
        },
    }  # You need to create this

    # Load the config from file and set initial values
    def my_load(user_config_name: str, profile_name: str) -> dict:
        # Read from config/<user_config_name>/<profile_name>.json
        file_path = f"config/{user_config_name}/{profile_name}.json"
        if os.path.exists(file_path):
            with open(file_path, "r", encoding="utf-8") as f:
                config = json.load(f)
        else:
            config = None
        return config


    # Create a ConfigEditor object
    config_editor = ConfigEditor(
        app_name="Trial",  # display name, is used in the webpage title
        main_entry=my_main_entry,  # optional, main entry point, make sure it can run in a thread.
    )

    # Maybe there are multiple configurations and profiles. You may use a for-loop to iterate all names (e.g., from file names of a specific directory.)

    # Create a UserConfig object
    cur_config_name = "user_info"
    cur_config_friendly_name = "User Info"
    cur_user_config = UserConfig(
        name=cur_config_name,  # identifier, "user_info"
        friendly_name=cur_config_friendly_name,  # display name, "User Info"
        schema=schema,  # schema
        extra_validation_func=always_pass,  # optional, extra validation function
        save_func=my_save,  # optional, save function
        default_profile_only=False,  # Defaults to False.
        # If True, this UserConfig contains only one default profile, and custom profiles are disabled.
    )

    cur_profile_name = "Alice"
    cur_config_from_file = my_load(
        cur_config_name,  # "user_info"
        cur_profile_name,  # "Alice"
    )

    cur_user_config.update_profile(
        name=cur_profile_name,  # "Alice"
        config=cur_config_from_file,
        skip_schema_validations=True,  # optional, skip schema validations this time only
        skip_extra_validations=True,  # optional, skip extra validations this time only
        save_file=False,  # Defaults to False
        # Usually, when users make a change to the config, update_profile will be called, and the changes are saved to both the memory and the file.
        # But now, saving to file is not necessary, since we just fetched the config from file.
    )

    # Add the UserConfig object to the ConfigEditor object
    config_editor.add_user_config(user_config=cur_user_config)
    ```

3. Run it

    Run the ConfigEditor!

    Example:
    ```python
    # Change the port to 5000 if you do not have enough permissions.
    config_editor.run(host="127.0.0.1", port=80)
    ```

## Acknowledgements
I would like to express my gratitude to the following projects and individuals for different scenarios and reasons:

- Front-end design:
  - JSON Editor: [JSON Schema Based Editor](https://github.com/json-editor/json-editor)
    - with version: `v2.15.2`
  - CSS: [Bootstrap · The most popular HTML, CSS, and JS library in the world.](https://getbootstrap.com/)
    - with version: `v5.3.3`
  - JavaScript Library: [jQuery](https://jquery.com/)
    - with version: `v3.7.1`
  - Icons: [Font Awesome](https://fontawesome.com/)
    - with version: `v5.15.4`
- Coding
  - Testing: My friend [Eric](https://github.com/EricWay1024)
    - for: providing valuable test feedback
  - Assistant: [ChatGPT](https://chatgpt.com/)
    - for: making things easier

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "configwebui-lucien",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "configuration, editor, web, tool, json, yaml, ui, flask",
    "author": null,
    "author_email": "Lucien Shaw <myxlc55@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/b3/bd/742047d0734c051ccf54a39934f5476b457eda3b1a7099eae9430703e538/configwebui_lucien-0.3.0.tar.gz",
    "platform": null,
    "description": "# pyConfigWebUI\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lucienshawls/py-config-web-ui)\n[![Build Status](https://github.com/lucienshawls/py-config-web-ui/actions/workflows/release.yml/badge.svg)](https://github.com/lucienshawls/py-config-web-ui/actions/workflows/release.yml)\n[![License](https://img.shields.io/github/license/lucienshawls/py-config-web-ui)](LICENSE)\n[![Latest Release Tag](https://img.shields.io/github/v/release/lucienshawls/py-config-web-ui)](https://github.com/lucienshawls/py-config-web-ui/releases/latest)\n[![Latest PyPI Version](https://img.shields.io/pypi/v/configwebui-lucien.svg)](https://pypi.org/project/configwebui-lucien/)\n\nA simple web-based configuration editor for Python applications.\n\nThis package provides tools for editing configuration files\nin a user-friendly web interface.\n\nPackage on PyPI: [configwebui-lucien \u00b7 PyPI](https://pypi.org/project/configwebui-lucien/)\n## What It Does\n\n**ConfigWebUI** is a lightweight and intuitive web-based configuration editor designed for Python applications. It allows developers to quickly generate user-friendly configuration interfaces from JSON schemas, enabling seamless configuration management without requiring users to understand the underlying file syntax.\n\n### Features\n\n- **Generate Configuration Interfaces Easily**: Provide a JSON schema, and ConfigWebUI generates a complete UI for configuration management.\n- **Support for Profiles**: Manage multiple configuration profiles for the same schema. Easily switch between profiles without editing configurations each time.\n- **Validation with Schema and Custom Logic**: The package validates configurations against the schema as users edit, ensuring data accuracy, and developers can specify additional backend validation to suit specific requirements.\n- **Asynchronous Processing**: Supports asynchronous program execution with real-time status updates.\n- **Interactive Terminal Output**: View and manage real-time program logs directly in the web UI.\n- **Non-intrusive Integration**: Easily integrates into existing Python projects without interfering with their core functionality. The tool operates independently and does not alter the program's behavior unless explicitly used.\n- **Seamless Fallback**: After applying this tool, your program can still run normally even if the web-based interface is not accessed. This ensures uninterrupted functionality in all scenarios.\n\n### Screenshots\n- Automatically generate a web interface with only a schema\n![A General Web Interface that allows users to edit configurations](docs/general.png)\n- Edit different profiles of different configs with ease\n![Users are allowed to edit different profiles of different configs and save configs](docs/save.png)\n- Run the main program and see the terminal output here\n![Running main program and show the terminal output](docs/run.png)\n\n## Try it out\nTo get an intuitive understanding of how to use this tool, you can do the following:\n\n1. Clone this repository\n    ```shell\n    git clone https://github.com/lucienshawls/py-config-web-ui\n    cd ./py-config-web-ui\n    ```\n\n2. Install dependencies in a virtual environment or a conda environment to avoid conflicts (or not).\n    ```shell\n    pip install -r ./requirements.txt\n    ```\n\n3. Run demo!\n    ```shell\n    python ./demo/demo_ui.py\n    ```\n\n4. Switch to your web browser\n\n    If your browser does not pop up, visit the link that shows in your terminal.\n\n5. Edit and save any config\n6. See if your config has been saved to `./demo/config`\n7. Click `Launch main program` (a submenu from `Save` in the navigation bar) and checkout the terminal output\n\n    It should run `./demo/demo_main.py` and display some messages based on the config, just like running that Python file from the terminal.\n\n## Architecture\nAs you see from the demo: with this package, your application can automatically generate a full-featured configuration editor UI from a schema. Here's how the architecture breaks down:\n\n```\nConfig Schema --(defined in)--> UserConfig --(included in)--> ConfigEditor --(features)--> Local Web UI\n```\n\n### 0. Data Format\nDevelopers can use `json`, `yaml`, `toml`, or any configuration format; just convert it to a Python `dict` when passing data into the system.\n\nInternally, everything works with plain `dict` objects: the package requires only a `dict` on input and returns a `dict` on output.\n\nThat means, developers never need to worry about parsing or formatting when interacting with this package; just read your config from whatever source, supply it as a `dict`, and receive a `dict` back when saving.\n\n### 1. Schema Input\nWrite a schema that defines the structure, defaults, types, and validation rules for each of your config. This schema becomes the single source of truth for generating the entire editor interface.\n\nLearn more about schemas: [Json Schema](https://json-schema.org/)\n\n### 2. UserConfig - Config Instance Wrapper\nEach config schema and its corresponding config data are wrapped inside a `UserConfig` object. This class:\n\n- Provides the schema for UI rendering;\n\n- Validates user inputs based on the schema (including required fields, types, ranges, enums, etc.);\n\n- Manages several profiles (they are based on the same schema; each stores an independent configuration);\n\n- Connects to a developer-defined validation function for custom validations (aside from schema-based validations);\n\n- Connects to a developer-defined save function to save configurations;\n\nThis modular design allows developers to manage multiple independent configurations within a single application.\n\n### 3. ConfigEditor - Main Web UI Controller\nThe ConfigEditor is the application's core orchestrator. It:\n\nStarts a local HTTP server to serve the web interface.\n\nManages one or more UserConfig instances.\n\nAutomatically generates interactive UI forms from each schema.\n\nHandles the UI-to-backend workflows: loading configuration data, saving updates, and invoking actions like running scripts.\n\n## Use it in your own project\n### 1. Installation\nActivate the python environment of your own project, and choose one of the installation methods:\n1. Online installation from PyPI\n```shell\npip install configwebui-lucien\n```\n2. Offline installtion from Github release\n\nDownload the `.whl` file from the [Latest Release](https://github.com/lucienshawls/py-config-web-ui/releases/latest). Install this using pip.\n\n3. Make your own build\n```shell\npip install setuptools setuptools-scm wheel build\npython -m build -n --sdist --wheel\n```\nThen you can get the `.whl` file from `./dist/`. Install this using pip.\n\n### 2. Import\n\nIn your python file, import this package:\n```python\nfrom configwebui import ConfigEditor, UserConfig, ResultStatus\n```\nor:\n\n```python\nfrom configwebui import *\n```\n\nThey have exactly the same effect.\n\n### 3. Integration\n1. Preparation\n\n    Generally, for each configuration, you will need:\n    - `schema` of type `dict`\n    - `extra_validation_function` which is `Callable`\n    - `save function` which is `Callable`\n\n    Additionally, you will need:\n    - `main_entry_point` which is `Callable`\n\n    In Detail:\n    - Set up a function that verifies the config\n\n        When user clicks the `Save` button on the webpage, the config will first pass the extra validations before it can be saved to the memory. You can set up your own validation function.\n\n        Your function should take two positional arguments:\n        - `name` of type `str`\n        - `config` of type `dict` or `None`\n\n        Your function should return a `ResultStatus` object or a `boolean` value. \n\n        If you choose the former, you can attach several error messages that the user can see on the webpage. For example, instantiate a `ResultStatus` object and set the messages:\n\n        ```python\n        from configwebui import *\n\n\n        # True indicates a success\n        res1 = ResultStatus(True, \"Success!\")\n\n        # False indicates a failure\n        res2 = ResultStatus(False, [\"Failed!\", \"Incorrect format\"])  # Message lists are also supported\n\n        # Alternatively, you can also instantiate a ResultStatus object with no messages, and add messages or change status later.\n        res3 = ResultStatus(True)\n        res3.set_status(False)\n        res3.add_message(\"message 1\")\n        ```\n\n        This validation function is related to a specific `UserConfig` that you set up later.\n\n        Example:\n        ```python\n        from configwebui import *\n\n\n        def always_pass(\n            config_name: str,\n            config: dict | None,\n        ) -> ResultStatus:\n            # Instantiate a ResultStatus object with no messages, and set its status to True.\n            res = ResultStatus(True)\n            if False:\n                # Just to show what to do when validation fails\n                res.set_status(False)\n                res.add_message(\"message 1\")\n                res.add_message(\"message 2\")\n\n            return res\n        ```\n\n    - Set up a function that saves config\n\n        When user clicks the `Save` button on the webpage, and after the config passes extra validations, the config is saved to the memory immediately and your save function is then called in a separate thread.\n\n        You can choose not to set the save function; however, if you do so, all edited configurations will only remain in memory and cannot be read, and will disappear when the program is restarted.\n\n        Your function should take three positional arguments:\n        - `user_config_name` of type `str`\n        - `profile_name` of type `str`\n        - `config` of type `dict`\n\n        Parameter validation is not needed. It is guaranteed that the parameters satisfy your requirements.\n\n        Return values are not needed either, because for now, the package does not read the result.\n\n        This function is related to a specific `UserConfig` that you set up later.\n\n        Example:\n        ```python\n        import json\n        import os\n\n        from configwebui import *\n\n\n        def my_save(user_config_name: str, profile_name: str, config: dict):\n            # You don't need to perform parameter validation\n            os.makedirs(f\"./config/{user_config_name}\", exist_ok=True)\n            with open(\n                f\"./config/{user_config_name}/{profile_name}.json\", \"w\", encoding=\"utf-8\"\n            ) as f:\n                json.dump(config, f, indent=4)\n            print(config)\n        ```\n\n    - Set up a main entry point\n\n        When user clicks `Launch main program` button on the webpage, your save function is called in a separate thread.\n\n        Your function should take no positional arguments.\n\n        Return values are not needed.\n\n        This function is related to a specific `ConfigEditor` that you set up later.\n\n        ATTENTION: Your main entry should be treated as an independent program that independently obtains configurations from the location where the configuration file is saved, and executes the code. Therefore, when the main entry is called, configuration-related parameters will not be passed in.\n\n        Example:\n        ```python\n        import json\n        import os\n\n\n        def my_main_entry():\n            print(\"======== This is main entry =======\")\n            if os.path.exists(\"config/myconfig.json\"):\n                with open(\"config/myconfig.json\", \"r\", encoding=\"utf-8\") as f:\n                    config = json.load(f)\n                print(config)\n        ```\n\n2. Fire it up\n\n    Instantiate a `ConfigEditor` object, and add one or more `UserConfig`s to it:\n    ```python\n    import os\n\n    from configwebui import *\n\n\n    schema = {\n        \"title\": \"Example Schema\",\n        \"type\": \"object\",\n        \"properties\": {\n            \"name\": {\"type\": \"string\", \"title\": \"Name\"},\n            \"age\": {\"type\": \"integer\", \"title\": \"Age\"},\n            \"is_student\": {\"type\": \"boolean\"},\n        },\n    }  # You need to create this\n\n    # Load the config from file and set initial values\n    def my_load(user_config_name: str, profile_name: str) -> dict:\n        # Read from config/<user_config_name>/<profile_name>.json\n        file_path = f\"config/{user_config_name}/{profile_name}.json\"\n        if os.path.exists(file_path):\n            with open(file_path, \"r\", encoding=\"utf-8\") as f:\n                config = json.load(f)\n        else:\n            config = None\n        return config\n\n\n    # Create a ConfigEditor object\n    config_editor = ConfigEditor(\n        app_name=\"Trial\",  # display name, is used in the webpage title\n        main_entry=my_main_entry,  # optional, main entry point, make sure it can run in a thread.\n    )\n\n    # Maybe there are multiple configurations and profiles. You may use a for-loop to iterate all names (e.g., from file names of a specific directory.)\n\n    # Create a UserConfig object\n    cur_config_name = \"user_info\"\n    cur_config_friendly_name = \"User Info\"\n    cur_user_config = UserConfig(\n        name=cur_config_name,  # identifier, \"user_info\"\n        friendly_name=cur_config_friendly_name,  # display name, \"User Info\"\n        schema=schema,  # schema\n        extra_validation_func=always_pass,  # optional, extra validation function\n        save_func=my_save,  # optional, save function\n        default_profile_only=False,  # Defaults to False.\n        # If True, this UserConfig contains only one default profile, and custom profiles are disabled.\n    )\n\n    cur_profile_name = \"Alice\"\n    cur_config_from_file = my_load(\n        cur_config_name,  # \"user_info\"\n        cur_profile_name,  # \"Alice\"\n    )\n\n    cur_user_config.update_profile(\n        name=cur_profile_name,  # \"Alice\"\n        config=cur_config_from_file,\n        skip_schema_validations=True,  # optional, skip schema validations this time only\n        skip_extra_validations=True,  # optional, skip extra validations this time only\n        save_file=False,  # Defaults to False\n        # Usually, when users make a change to the config, update_profile will be called, and the changes are saved to both the memory and the file.\n        # But now, saving to file is not necessary, since we just fetched the config from file.\n    )\n\n    # Add the UserConfig object to the ConfigEditor object\n    config_editor.add_user_config(user_config=cur_user_config)\n    ```\n\n3. Run it\n\n    Run the ConfigEditor!\n\n    Example:\n    ```python\n    # Change the port to 5000 if you do not have enough permissions.\n    config_editor.run(host=\"127.0.0.1\", port=80)\n    ```\n\n## Acknowledgements\nI would like to express my gratitude to the following projects and individuals for different scenarios and reasons:\n\n- Front-end design:\n  - JSON Editor: [JSON Schema Based Editor](https://github.com/json-editor/json-editor)\n    - with version: `v2.15.2`\n  - CSS: [Bootstrap \u00b7 The most popular HTML, CSS, and JS library in the world.](https://getbootstrap.com/)\n    - with version: `v5.3.3`\n  - JavaScript Library: [jQuery](https://jquery.com/)\n    - with version: `v3.7.1`\n  - Icons: [Font Awesome](https://fontawesome.com/)\n    - with version: `v5.15.4`\n- Coding\n  - Testing: My friend [Eric](https://github.com/EricWay1024)\n    - for: providing valuable test feedback\n  - Assistant: [ChatGPT](https://chatgpt.com/)\n    - for: making things easier\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple web-based configuration editor for Python applications.",
    "version": "0.3.0",
    "project_urls": {
        "Documentation": "https://github.com/lucienshawls/py-config-web-ui/blob/master/README.md",
        "Homepage": "https://github.com/lucienshawls/py-config-web-ui",
        "Release notes": "https://github.com/lucienshawls/py-config-web-ui/releases",
        "Source": "https://github.com/lucienshawls/py-config-web-ui.git",
        "Tracker": "https://github.com/lucienshawls/py-config-web-ui/issues"
    },
    "split_keywords": [
        "configuration",
        " editor",
        " web",
        " tool",
        " json",
        " yaml",
        " ui",
        " flask"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bbf0becf9b62064227a91747b9fba387e70804a1091e99d29a36acf0c13bdeb1",
                "md5": "e3ab89ed08bb13a588655eaade342c60",
                "sha256": "5d80f34e475df192ce2a341257587d05ac3e4f35f54724ca6f8dd77919b4f8c5"
            },
            "downloads": -1,
            "filename": "configwebui_lucien-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e3ab89ed08bb13a588655eaade342c60",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 1598368,
            "upload_time": "2025-07-28T07:24:31",
            "upload_time_iso_8601": "2025-07-28T07:24:31.787979Z",
            "url": "https://files.pythonhosted.org/packages/bb/f0/becf9b62064227a91747b9fba387e70804a1091e99d29a36acf0c13bdeb1/configwebui_lucien-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b3bd742047d0734c051ccf54a39934f5476b457eda3b1a7099eae9430703e538",
                "md5": "ba65b217f1e6fc703639618685aac8f9",
                "sha256": "b854f124171ed9f4542776cb4b361f114c9f7cb8bfd164ecc9653cad8db37377"
            },
            "downloads": -1,
            "filename": "configwebui_lucien-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ba65b217f1e6fc703639618685aac8f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 2068543,
            "upload_time": "2025-07-28T07:24:33",
            "upload_time_iso_8601": "2025-07-28T07:24:33.634091Z",
            "url": "https://files.pythonhosted.org/packages/b3/bd/742047d0734c051ccf54a39934f5476b457eda3b1a7099eae9430703e538/configwebui_lucien-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 07:24:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lucienshawls",
    "github_project": "py-config-web-ui",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "Flask",
            "specs": []
        },
        {
            "name": "jsonschema",
            "specs": []
        }
    ],
    "lcname": "configwebui-lucien"
}
        
Elapsed time: 0.76176s