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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file yaml_extensions-0.0.2.tar.gz.

File metadata

  • Download URL: yaml_extensions-0.0.2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for yaml_extensions-0.0.2.tar.gz
Algorithm Hash digest
SHA256 51dba93c0fc9e4b2af25ba87c5fa97b3ab9f0fe528a48fab3a21a2ca709d14b8
MD5 f1d2b64bcd0d78a8e2a638c055b355e8
BLAKE2b-256 011f061aea11bb721581a6d313ad719fa0c601877a7eeb30fce37c900e7fba98

See more details on using hashes here.

File details

Details for the file yaml_extensions-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for yaml_extensions-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d34df696c8a049b0f033b777085b1fa7f414fc6ed17a3a63ce25bbf3486b18f9
MD5 6aa615ce37bb25feed989b51ff56d613
BLAKE2b-256 0a455f956d2012c3da3893e11f025f8f0e08d0673b1c66abbdfac3b13b30ff15

See more details on using hashes here.

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