Skip to main content

No project description provided

Project description

Schemed YAML Config

Schemed YAML Config is a library to read and validate YAML based configuration files against JSON Schema 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 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.

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 configuration files as experimental feature since v0.1.0. TOML schemas are not supported yet!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schemed-yaml-config-0.1.1a0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schemed_yaml_config-0.1.1a0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file schemed-yaml-config-0.1.1a0.tar.gz.

File metadata

  • Download URL: schemed-yaml-config-0.1.1a0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+

File hashes

Hashes for schemed-yaml-config-0.1.1a0.tar.gz
Algorithm Hash digest
SHA256 443dcf4e9401e6da02eb190fe0a9063e8f5881493b1bb649a7acdca73ad8c567
MD5 98962f90bb89cab8aec1f3a77639f707
BLAKE2b-256 cbdaa45b43bc850bf688f1798a2cb795f37e8f10d009ba329c1951a76c86049f

See more details on using hashes here.

File details

Details for the file schemed_yaml_config-0.1.1a0-py3-none-any.whl.

File metadata

  • Download URL: schemed_yaml_config-0.1.1a0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+

File hashes

Hashes for schemed_yaml_config-0.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 47e7dbf396078832865ea2261cb97458128cdb69e03c0188aadb05c018516468
MD5 296e9d3df2460571ed850892ac6e32af
BLAKE2b-256 a8401d094fbb546d5195dc10fbdb6d8e5e9b46bd4ba1e73f98abeef2ee04d6ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page