Skip to main content
Latest PyPI version Number of PyPI downloads Test node.ext.yaml

node.ext.yaml provides a node implementation to yaml files.

For more information on nodes see node package.

For more information on plumbing see plumber package.

Usage

Create a yaml file:

from node.ext.yaml import YamlFile

class MyYamlFile(YamlFile):

    @property
    def fs_path(self):
        return '/path/to/file.yaml'

file = MyYamlFile()
file['child'] = 'Value'

# write file to disk
file()

Define factories for child nodes:

from node.ext.yaml import YamlNode

class SpecificChild(YamlNode):
    pass

class DefaultChild(YamlNode):
    pass

class MyYamlFile(YamlFile):
    factories = {
        'child': SpecificChild,
        '*': DefaultChild
    }

Define a schema for node members:

from node import schema
from node.behaviors import SchemaAsAttributes
from plumber import plumbing

@plumbing(SchemaAsAttributes)
class MyYamlFile(YamlFile):
    schema = {
        'int_member': schema.Int(),
        'str_member': schema.Str()
    }

file = MyYamlFile()
file.attr['int_member'] = 1
file.attr['str_member'] = u'String'

Schema members can be defined directly on class.

Note: Be careful not to override existing API members.

from node.behaviors import SchemaProperties

@plumbing(SchemaProperties)
class MyYamlFile(YamlFile):
    int_member = schema.Int()
    str_member = schema.Str()

file = MyYamlFile()
file.int_member = 1
file.str_member = u'String'

Python Versions

  • Python 2.7, 3.3+

Contributors

  • Robert Niederreiter

Changes

2.0.1 (2026-10-31)

  • Sort the imports with ruff (one per line, from imports first, no sections) and format the code with ruff format (90 characters per line, single quotes). [rnix]

  • Add qa.ruff domain to Makefile and pin the ruff configuration in pyproject.toml, make check runs ruff check. [rnix]

2.0.0 (2026-02-03)

  • Refactor package layout to use pyproject.toml and implicit namespace packages. [rnix]

0.4 (2025-10-25)

  • Pin upper versions of dependencies. [rnix]

0.3 (2022-12-21)

  • node.ext.yaml.behaviors.YamlSequenceStorage implements now __contains__, which compares the storage values directly. This is needed to make containment checks work because yaml child nodes are not cached on __getitem__. [rnix]

  • node.ext.yaml.behaviors.YamlMember provides now default_mapping_factory and default_sequence_factory settings. [rnix]

  • node.ext.yaml.behaviors.YamlMember inherits from node.behaviors.WildcardFactory now. [rnix]

  • Use node.behaviors.SequenceAdopt and node.behaviors.SequenceOrder behaviors on node.ext.yaml.YamlSequence. [rnix]

  • Use node.behaviors.MappingOrder behavior in favor of node.behaviors.Order as introduced in node 1.2 on node.ext.yaml.YamlMapping and node.ext.yaml.YamlFile. [rnix]

0.2 (2022-10-06)

  • Inherit YamlRootStorage from node.ext.fs.FSLocation, which provides fs_path property. Note that fs_path is handled as list now. [rnix]

  • Inherit IYamlRoot from node.ext.fs.interfaces.IFile. [rnix]

  • Package depends on node.ext.fs now. [rnix]

  • Replace deprecated use of Adopt by MappingAdopt. [rnix]

  • node.ext.yaml.YamlNode and node.ext.yaml.YamlFile not provides a default child factory any more. [rnix]

0.1 (2021-11-22)

  • Initial work [rnix]

License

Copyright (c) 2021-2025, Node Contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Metadata

Release files for node.ext.yaml 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for node.ext.yaml 2.0.1
File Size Uploaded Provenance Actions
node_ext_yaml-2.0.1.tar.gz 9.0 kB Without provenance Details for node_ext_yaml-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for node.ext.yaml 2.0.1
File Interpreter ABI Platform Actions
node_ext_yaml-2.0.1-py3-none-any.whl Python 3 none any Details for node_ext_yaml-2.0.1-py3-none-any.whl

Total release size: 18.6 kB

Release files / node_ext_yaml-2.0.1.tar.gz

Download URL node_ext_yaml-2.0.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d19a176026193fd4e614a02be53fbeca86d4074c785da9be42d4a24339fc686e
BLAKE2b-256 checksum
How to use checksums
41248b4516b3acb2f83f9beeb744264e13ecb896325e555b8f7f04a853d30ef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / node_ext_yaml-2.0.1-py3-none-any.whl

Download URL node_ext_yaml-2.0.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
025a8f1c815501ace88258a6478f7a254f62e23d4f7fe0951a70d9061f39e0c1
BLAKE2b-256 checksum
How to use checksums
5ecefbf385fef4b0ac336309f28e818e6d72c75fe6d97df7e6f7ad58cba424fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for node.ext.yaml 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page