Skip to main content

A Python library with common YAML utility functions supporting 'Network as Code'.

Project description

Tests Python Support

nac-yaml

A Python library with common YAML utility functions supporting Network as Code.

Usage

Load and merge YAML files

from pathlib import Path
from nac_yaml.yaml import load_yaml_files

# Default is ruamel's round-trip loader (preserves formatting internally).
data = load_yaml_files([
    Path("path/to/file1.yaml"),
    Path("path/to/file2.yaml"),
])

# Use the safe loader to get native dict/list containers.
data_safe = load_yaml_files([
    Path("path/to/file1.yaml"),
    Path("path/to/file2.yaml"),
], typ="safe")

Note: when typ is not round-trip (e.g. "safe"), formatting features (quotes/comments/style) are not preserved.

Installation

Using uv (recommended)

uv add nac-yaml

Using pip

pip install nac-yaml

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

nac_yaml-2.0.0b2.tar.gz (80.1 kB view details)

Uploaded Source

Built Distribution

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

nac_yaml-2.0.0b2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file nac_yaml-2.0.0b2.tar.gz.

File metadata

  • Download URL: nac_yaml-2.0.0b2.tar.gz
  • Upload date:
  • Size: 80.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nac_yaml-2.0.0b2.tar.gz
Algorithm Hash digest
SHA256 811ad28d4fb789eecd861fbc363193989ba65dd4f5c7fd4c0fca75be2a0c5237
MD5 34a271cd66e1c6b8be05c7b54902a707
BLAKE2b-256 aa8ca66cbcb3856a7865b667aa9c0f9037f77a528b34a907417daf68e6dbbbc7

See more details on using hashes here.

File details

Details for the file nac_yaml-2.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: nac_yaml-2.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nac_yaml-2.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 2d3b206b674c054991dfd69382264a247f018faf9b04effce86e7718f37ebd5d
MD5 5602884f721192f66f0f0fe7e7643be7
BLAKE2b-256 aa814b538bdaeae7a0152187c2320b7be80fcce6383510ea3d1f3d7b1f910206

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