schemed-yaml-config


Nameschemed-yaml-config JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/lamehost/schemed-yaml-config/
Summary
upload_time2021-01-18 18:11:40
maintainer
docs_urlNone
authorMarco Marzetti
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Schemed YAML Config
Schemed YAML Config is a library to read and validate [YAML](https://yaml.org/) based configuration files against [JSON Schema](https://json-schema.org/) specifications.  

# Install
Schemed-yaml-config can be installed via PIP
```
# pip install schemed-yaml-config
```

# Under the hood
Schemed YAML Config works by converting YAML files into a dictionarie by mean of the well known [PyYAML framework](https://pyyaml.org/) and then by applying JSON Schema specifications before of returning it to rest of the script.  
The beauty of this approach is it combines the human friendly serialization of YAML with the power of JSON Schema.

![](https://github.com/lamehost/schemed-yaml-config/raw/master/images/venn_diagram.png)

A few tricks has been added to make the library even more human friendly. For instance when the a configuration file is missing and a default is created, order and comments of the keys from the schema are borrowed to the YAML file.

# Syntax
```
Python 3.7.4 (default, Aug 21 2019, 16:01:23)
[GCC 9.2.1 20190813] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from schemed_yaml_config import get_config
>>> config = get_config('config.yml', 'schema.yml')
>>> print(config)
{'listen': {'host': '192.0.2.1', 'port': 1025}, 'tmpdir': '/tmp'}
>>>
```

# TOML
Despite its name Schemed YAML Config also supports [TOML](https://toml.io/en/) configuration files as experimental feature since version 0.1.0.  
TOML schemas are not supported yet!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lamehost/schemed-yaml-config/",
    "name": "schemed-yaml-config",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Marco Marzetti",
    "author_email": "marco@lamehost.it",
    "download_url": "https://files.pythonhosted.org/packages/53/3a/c589238a5a61dbee60ad7b6b021e637bbc33bbd4c65a65cf2caa8824951a/schemed-yaml-config-0.1.0.tar.gz",
    "platform": "",
    "description": "# Schemed YAML Config\nSchemed YAML Config is a library to read and validate [YAML](https://yaml.org/) based configuration files against [JSON Schema](https://json-schema.org/) specifications.  \n\n# Install\nSchemed-yaml-config can be installed via PIP\n```\n# pip install schemed-yaml-config\n```\n\n# Under the hood\nSchemed YAML Config works by converting YAML files into a dictionarie by mean of the well known [PyYAML framework](https://pyyaml.org/) and then by applying JSON Schema specifications before of returning it to rest of the script.  \nThe beauty of this approach is it combines the human friendly serialization of YAML with the power of JSON Schema.\n\n![](https://github.com/lamehost/schemed-yaml-config/raw/master/images/venn_diagram.png)\n\nA few tricks has been added to make the library even more human friendly. For instance when the a configuration file is missing and a default is created, order and comments of the keys from the schema are borrowed to the YAML file.\n\n# Syntax\n```\nPython 3.7.4 (default, Aug 21 2019, 16:01:23)\n[GCC 9.2.1 20190813] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>>\n>>> from schemed_yaml_config import get_config\n>>> config = get_config('config.yml', 'schema.yml')\n>>> print(config)\n{'listen': {'host': '192.0.2.1', 'port': 1025}, 'tmpdir': '/tmp'}\n>>>\n```\n\n# TOML\nDespite its name Schemed YAML Config also supports [TOML](https://toml.io/en/) configuration files as experimental feature since version 0.1.0.  \nTOML schemas are not supported yet!\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.1.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "398f45f4b94c83513c5cdc40e121d030",
                "sha256": "7ee411be0d94a574e22884cccb2e910ba43507cc190d66db0dc25424bda88bf7"
            },
            "downloads": -1,
            "filename": "schemed_yaml_config-0.1.0-py3.9.egg",
            "has_sig": false,
            "md5_digest": "398f45f4b94c83513c5cdc40e121d030",
            "packagetype": "bdist_egg",
            "python_version": "3.9",
            "requires_python": null,
            "size": 8721,
            "upload_time": "2021-01-18T18:11:39",
            "upload_time_iso_8601": "2021-01-18T18:11:39.245924Z",
            "url": "https://files.pythonhosted.org/packages/eb/0b/615f49625f4a9ab87946553cde7181bb61880b6f6cc81e3e7e037838d74f/schemed_yaml_config-0.1.0-py3.9.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "433bb8d0df227dcada70d817f09c35de",
                "sha256": "7aeb2496a171a185a0c4b49129f50f5ac4b0cd79865a07539c79f385529e4b63"
            },
            "downloads": -1,
            "filename": "schemed_yaml_config-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "433bb8d0df227dcada70d817f09c35de",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8358,
            "upload_time": "2021-01-18T18:11:34",
            "upload_time_iso_8601": "2021-01-18T18:11:34.436955Z",
            "url": "https://files.pythonhosted.org/packages/fb/e3/15eef3a1c2922f3aba13f699b55d12ae2bd592dbb30432f5af707ddeaa32/schemed_yaml_config-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "e73e701603596498e57f278e6286fe4e",
                "sha256": "4cf9f099440f10c70fbfe1ee10a7e22d66e09b033f54f0207ad25d9efdac5a6c"
            },
            "downloads": -1,
            "filename": "schemed-yaml-config-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e73e701603596498e57f278e6286fe4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6021,
            "upload_time": "2021-01-18T18:11:40",
            "upload_time_iso_8601": "2021-01-18T18:11:40.513404Z",
            "url": "https://files.pythonhosted.org/packages/53/3a/c589238a5a61dbee60ad7b6b021e637bbc33bbd4c65a65cf2caa8824951a/schemed-yaml-config-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-01-18 18:11:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "lamehost",
    "error": "Could not fetch GitHub repository",
    "lcname": "schemed-yaml-config"
}
        
Elapsed time: 0.18782s