Skip to main content

No project description provided

Project description

Extensions for PyYAML

Inclusions

This implements a simple inclusion interface. If used, any inclusions will be assumed to be relative paths to the YAML file being loaded, if the location can be determined, otherwise relative to the current working directory.

from yaml_extensions.inclusions import InclusionSafeLoader

with open("outer.yaml", "r") as yaml_fp:
    my_yaml = yaml.load(
        yaml_fp,
        loader=InclusionSafeLoader
    )

This allows outer.yaml to be split into two files, e.g.:

outer.yaml

fizz:
    buzz: !include "inner.yaml"

inner.yaml

bar:
    bell: 51

will become:

{
    "fizz": {
        "buzz": {
            "bar": {
                "bell": 51
            }
        }
    }
}

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

yaml_extensions-0.0.2.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

yaml_extensions-0.0.2-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

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