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.0.tar.gz
(97.5 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
nac_yaml-2.0.0-py3-none-any.whl
(13.2 kB
view details)
File details
Details for the file nac_yaml-2.0.0.tar.gz.
File metadata
- Download URL: nac_yaml-2.0.0.tar.gz
- Upload date:
- Size: 97.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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 |
2d92136f7570d8a87330df28125f1075694d750b3bf73535c5d0a074bfec6cf7
|
|
| MD5 |
caf774872d6ac5cf770667e2f3f40736
|
|
| BLAKE2b-256 |
2bf80b58a5ad2fd7d40444b77a8b875032143ae0e2a68ed8cd9060cdc48e438e
|
File details
Details for the file nac_yaml-2.0.0-py3-none-any.whl.
File metadata
- Download URL: nac_yaml-2.0.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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 |
5b989a08c6434cbf5f0377a5a746c7b79278bdf1650e8373e476952be9280ecd
|
|
| MD5 |
4a8d88ea0bc171a29dcaa939c95165f5
|
|
| BLAKE2b-256 |
94ae888f5d96651c126de84a85776d79a3ba409fcb4e9dbc2043963651e31af2
|