A Python library with common YAML utility functions supporting 'Network as Code'.
Project description
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
Release history Release notifications | RSS feed
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.0b3.tar.gz
(80.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nac_yaml-2.0.0b3.tar.gz.
File metadata
- Download URL: nac_yaml-2.0.0b3.tar.gz
- Upload date:
- Size: 80.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71055c4fc3440c36e247265d4fcce48ca751a94862dea605874fc854b063ee98
|
|
| MD5 |
ace9782b2f432e6e718ab501774b0f88
|
|
| BLAKE2b-256 |
b2f846bec9136158b5931e35f0be5a528f8c73179d57b2c1b141c7cc6faaad92
|
File details
Details for the file nac_yaml-2.0.0b3-py3-none-any.whl.
File metadata
- Download URL: nac_yaml-2.0.0b3-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74fbbcbd7caa08f9f0a616d43ea43d14330ca3a36f28c222f4270dec987c7b9a
|
|
| MD5 |
1511668861ff7e66a7c4fecb0eda73d8
|
|
| BLAKE2b-256 |
15c00829ed3353613e653df73f1d606f5f97100c8546433a1f83f87435d2c6c0
|