YMLEditor


NameYMLEditor JSON
Version 0.1.17 PyPI version JSON
download
home_pageNone
SummaryYMLEditor is a package for quickly creating editors for simple YAML configuration files.
upload_time2024-12-16 18:36:50
maintainerNone
docs_urlNone
authorcorb
requires_python>=3.8
licenseNone
keywords yaml configuration editor
VCS
bugtrack_url
requirements pytest PyQt6 PyYAML
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Readme

<img width="622" alt="sample" src="https://github.com/corb555/YMLEditor/blob/62749ffe58806449d0adba7040e1157ae4b184c2/images/YMLEditor.png?raw=true">

## Overview

`YMLEditor` is a package for easily creating editors for simple configuration files.  

## Features

**SettingsWidget** provides a Widget for displaying and editing config file fields. You
simply list the fields with their config key and the widget you want for each (line_edit, text_edit, label,
combo-box). You can also add a regex for data entry validation. The SettingsWiget and YamlConfig  will
read the config file, display the fields for editing, and then save the data.

- **Easy Front-End Creation:** Create a configuration editor with a few lines of code.
- **Configurable Layout:** Displays settings using the format you provide.
- **Widget Support:** Supports these QT widgets: text edit, line edit, combo box, and label.
- **Input Validation:** Validates input based on supplied regular expressions and 
highlights invalid entries. In the sample above, Tip Amount is highlighted because it contains letters.
- **Data Syncing:** Synchronizes data values between the UI and the config file, seamlessly using the
  ConfigFile manager described below.
- **Utilizes PyQt6**

**YamlConfig** provides functionality for creating, loading, updating, and saving YAML files using PyYAML.

- **Load / Save / Create** Provides interfaces to load and save YAML files and to create new YAML files.
- **Get / Set Operations:** Provides simple key/value access to data fields in the YAML configuration, including
scalars (int, float, str, bool, date), lists, and dictionaries.  _Complex  hierarchies are not supported._
- **Undo Support:** Keeps a snapshot for each save _in session_ and restores from stack.
- **Granular Dependency Management:** For build system integration, this can be configured to touch a proxy file 
when a specified field changes, offering more granular dependency tracking for build systems.

## Installation

To install `YMLEditor`:

```bash
pip install YMLEditor
```

### Format Layout

Each line in the format corresponds to a field in the config file:  
`ConfigKey: (DisplayName, WidgetType, Options, Width)`

- Config Key: The name of the item in the YAML config file
- Display Name: The name to show in the UI.
- Widget Type: The type of input control "text_edit", "line_edit", "label", "read_only", or "combo_box".
- Options: Either a regex pattern for field validation (e.g., line_edit), 
       or a list of items for selection (e.g., combo box).
- Field Width: Width of the widget in the UI.

### Sample layout format

```python
formats = {
       "layout1": {
              "TIP": ("Tip Amount", "line_edit", r'^\d{1,2}$', 50),
              "DESSERT": ("Dessert", "combo", ["Tiramisu", "Apple Tart", "Cheesecake"], 200),
              "HOME": ("Home", "combo", ["A", "B", "C"], 200),   
              "SITES.@HOME": ("Preferred", "read_only", None, 180),
              "SITES.B": ("Location B", "line_edit", None, 180), 
              "SITES": ("Sites", "line_edit", None, 300),
       },
}
```
- SITES.@HOME - If '@' is present, that key will be looked up and replace by its contents (SITES.C in this example)
- SITES.B - You can access sub hierarchies by using "." to separate keys (Boston in this example)
- TIP - The regex for Tips highlights entries that aren't simply 1 or 2 digits.

### Sample YAML file

```yaml
TIP: 18
DESSERT: Cheesecake
HOME: C
SITES:
  A: New Orleans
  B: Boston
  C: Vancouver
  ```

### Sample App

Sample.py is provided to demonstrate the capabilities of `YMLEditor` with a sample YAML file.

## License

`YMLEditor` is licensed under the MIT License. See [LICENSE](LICENSE) for details.  

This uses QT for some components which has the primary open-source license is the GNU Lesser General Public License v. 3 (“LGPL”). 
With the LGPL license option, you can use the essential libraries and some add-on libraries of Qt.
See https://www.qt.io/licensing/open-source-lgpl-obligations for QT details.

## NOTES
- Only basic YAML syntax is supported:
- Data type specification tags such as !!int, !!float, etc. are ignored
- Anchors and aliases are not supported
- Comments are stripped

## Support
To report an issue, please visit the [issue tracker](https://github.com/corb555/YMLEditor/issues).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "YMLEditor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "YAML, configuration, editor",
    "author": "corb",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# Readme\n\n<img width=\"622\" alt=\"sample\" src=\"https://github.com/corb555/YMLEditor/blob/62749ffe58806449d0adba7040e1157ae4b184c2/images/YMLEditor.png?raw=true\">\n\n## Overview\n\n`YMLEditor` is a package for easily creating editors for simple configuration files.  \n\n## Features\n\n**SettingsWidget** provides a Widget for displaying and editing config file fields. You\nsimply list the fields with their config key and the widget you want for each (line_edit, text_edit, label,\ncombo-box). You can also add a regex for data entry validation. The SettingsWiget and YamlConfig  will\nread the config file, display the fields for editing, and then save the data.\n\n- **Easy Front-End Creation:** Create a configuration editor with a few lines of code.\n- **Configurable Layout:** Displays settings using the format you provide.\n- **Widget Support:** Supports these QT widgets: text edit, line edit, combo box, and label.\n- **Input Validation:** Validates input based on supplied regular expressions and \nhighlights invalid entries. In the sample above, Tip Amount is highlighted because it contains letters.\n- **Data Syncing:** Synchronizes data values between the UI and the config file, seamlessly using the\n  ConfigFile manager described below.\n- **Utilizes PyQt6**\n\n**YamlConfig** provides functionality for creating, loading, updating, and saving YAML files using PyYAML.\n\n- **Load / Save / Create** Provides interfaces to load and save YAML files and to create new YAML files.\n- **Get / Set Operations:** Provides simple key/value access to data fields in the YAML configuration, including\nscalars (int, float, str, bool, date), lists, and dictionaries.  _Complex  hierarchies are not supported._\n- **Undo Support:** Keeps a snapshot for each save _in session_ and restores from stack.\n- **Granular Dependency Management:** For build system integration, this can be configured to touch a proxy file \nwhen a specified field changes, offering more granular dependency tracking for build systems.\n\n## Installation\n\nTo install `YMLEditor`:\n\n```bash\npip install YMLEditor\n```\n\n### Format Layout\n\nEach line in the format corresponds to a field in the config file:  \n`ConfigKey: (DisplayName, WidgetType, Options, Width)`\n\n- Config Key: The name of the item in the YAML config file\n- Display Name: The name to show in the UI.\n- Widget Type: The type of input control \"text_edit\", \"line_edit\", \"label\", \"read_only\", or \"combo_box\".\n- Options: Either a regex pattern for field validation (e.g., line_edit), \n       or a list of items for selection (e.g., combo box).\n- Field Width: Width of the widget in the UI.\n\n### Sample layout format\n\n```python\nformats = {\n       \"layout1\": {\n              \"TIP\": (\"Tip Amount\", \"line_edit\", r'^\\d{1,2}$', 50),\n              \"DESSERT\": (\"Dessert\", \"combo\", [\"Tiramisu\", \"Apple Tart\", \"Cheesecake\"], 200),\n              \"HOME\": (\"Home\", \"combo\", [\"A\", \"B\", \"C\"], 200),   \n              \"SITES.@HOME\": (\"Preferred\", \"read_only\", None, 180),\n              \"SITES.B\": (\"Location B\", \"line_edit\", None, 180), \n              \"SITES\": (\"Sites\", \"line_edit\", None, 300),\n       },\n}\n```\n- SITES.@HOME - If '@' is present, that key will be looked up and replace by its contents (SITES.C in this example)\n- SITES.B - You can access sub hierarchies by using \".\" to separate keys (Boston in this example)\n- TIP - The regex for Tips highlights entries that aren't simply 1 or 2 digits.\n\n### Sample YAML file\n\n```yaml\nTIP: 18\nDESSERT: Cheesecake\nHOME: C\nSITES:\n  A: New Orleans\n  B: Boston\n  C: Vancouver\n  ```\n\n### Sample App\n\nSample.py is provided to demonstrate the capabilities of `YMLEditor` with a sample YAML file.\n\n## License\n\n`YMLEditor` is licensed under the MIT License. See [LICENSE](LICENSE) for details.  \n\nThis uses QT for some components which has the primary open-source license is the GNU Lesser General Public License v. 3 (\u201cLGPL\u201d). \nWith the LGPL license option, you can use the essential libraries and some add-on libraries of Qt.\nSee https://www.qt.io/licensing/open-source-lgpl-obligations for QT details.\n\n## NOTES\n- Only basic YAML syntax is supported:\n- Data type specification tags such as !!int, !!float, etc. are ignored\n- Anchors and aliases are not supported\n- Comments are stripped\n\n## Support\nTo report an issue, please visit the [issue tracker](https://github.com/corb555/YMLEditor/issues).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "YMLEditor is a package for quickly creating editors for simple YAML configuration files.",
    "version": "0.1.17",
    "project_urls": {
        "Repository": "https://github.com/corb555/YMLEditor"
    },
    "split_keywords": [
        "yaml",
        " configuration",
        " editor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91fe059ba245a46298b27178ee294e58abcf3523ce32bf4a3ffe9bbfb2815563",
                "md5": "b25f38aa17da26f065eb38fc146c2087",
                "sha256": "d96cbd0e2c4652622989bf7c4fbac0f1b632f7ed62b8be0e2779eb9d1c6e14a2"
            },
            "downloads": -1,
            "filename": "YMLEditor-0.1.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b25f38aa17da26f065eb38fc146c2087",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 23843,
            "upload_time": "2024-12-16T18:36:50",
            "upload_time_iso_8601": "2024-12-16T18:36:50.593575Z",
            "url": "https://files.pythonhosted.org/packages/91/fe/059ba245a46298b27178ee294e58abcf3523ce32bf4a3ffe9bbfb2815563/YMLEditor-0.1.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 18:36:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "corb555",
    "github_project": "YMLEditor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "8.3.3"
                ]
            ]
        },
        {
            "name": "PyQt6",
            "specs": [
                [
                    ">=",
                    "6.6.1"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    ">=",
                    "6.0.2"
                ]
            ]
        }
    ],
    "lcname": "ymleditor"
}
        
Elapsed time: 0.43715s