pyaml-env
Provides yaml file parsing with environment variable resolution
Decision gist · record as of 2026-08-14
Yes, if you use YAML for configuration and need to inject secrets via environment variables. The package is lightweight, has no security vulnerabilities, and solves a common deployment pattern. Dormant maintenance is acceptable for a stable, single-purpose tool. Install if your workflow already involves YAML and environment-based secrets; skip if you prefer .env files or other config systems.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Environment variables must be set before parse_config() is called; unset variables without defaults resolve to 'N/A' by default.
- Low friction: single runtime dependency (PyYAML), pure Python wheel, dormant maintenance status (last commit 2025-01-13, 578 days since release) but no active issues flagged.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) — you can use, modify, and distribute freely with minimal restrictions.
last release 2025-01-13 (578 days) · last repo commit 2025-01-13 · 99 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 203,671 downloads/mo, #9,627 on PyPI
Alternatives
Verify before relying
pip install pyaml-env
from pyaml_env import parse_config
config = parse_config('config.yaml')
# YAML file contains: username: !ENV ${DB_USER}
# Resolves to: config['username'] = os.environ['DB_USER']- Whether the package handles concurrent or multi-threaded config loading safely.
- Performance characteristics when parsing large YAML files with many environment variable substitutions.
- Compatibility with YAML anchors, aliases, and other advanced YAML features alongside environment variable tags.
What it is and what it does
pyaml-env is a thin wrapper around PyYAML that adds environment variable resolution to YAML configuration files. It lets you mark values with a custom tag (default !ENV) and substitute environment variables at parse time, keeping secrets out of version control. The library supports default values using a separator (default :), custom YAML loaders, type coercion via YAML's standard type tags, and attribute-style access through a BaseConfig wrapper.
Typical use: define a YAML config with placeholders like `password: !ENV ${DB_PASS:fallback}`, set environment variables before running your app, then call parse_config() to get a dictionary with all variables resolved. If a variable is unset and has no default, it becomes 'N/A' by default—or you can raise an error instead with raise_if_na=True.
Use it for
- Load database credentials from environment variables in a YAML config without hardcoding secrets.
- Manage different configurations per deployment environment (dev, staging, prod) by varying environment variables.
- Provide default fallback values for optional config parameters while requiring critical ones to be set.
- Parse YAML files containing serialized Python objects using a custom loader like yaml.UnsafeLoader.
- Access nested config values as attributes (e.g., config.database.url) via BaseConfig wrapper.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use YAML for configuration and need to inject secrets via environment variables.
The package is lightweight, has no security vulnerabilities, and solves a common deployment pattern. Dormant maintenance is acceptable for a stable, single-purpose tool. Install if your workflow already involves YAML and environment-based secrets; skip if you prefer .env files or other config systems.
Install
pyaml-env on PyPI
Before you install
Low friction: single runtime dependency (PyYAML), pure Python wheel, dormant maintenance status (last commit 2025-01-13, 578 days since release) but no active issues flagged.
Environment variables must be set before parse_config() is called; unset variables without defaults resolve to 'N/A' by default.
License in practice
MIT license (permissive) — you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install pyaml-env
from pyaml_env import parse_config
config = parse_config('config.yaml')
# YAML file contains: username: !ENV ${DB_USER}
# Resolves to: config['username'] = os.environ['DB_USER']
Verify before relying
- Whether the package handles concurrent or multi-threaded config loading safely.
- Performance characteristics when parsing large YAML files with many environment variable substitutions.
- Compatibility with YAML anchors, aliases, and other advanced YAML features alongside environment variable tags.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagePyYAML |
| Maintenance | Dormant 578 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 203,671 / month, #9,627 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: pyaml_env-1.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “yaml config environment variables”
- pyaml-envParses YAML configuration files and resolves environment variables…
- envyamlParses YAML configuration files with environment variable…
- pyyaml-env-tagAdds a custom YAML tag that lets you reference environment variables…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also pyyaml-env-tag · annotatedyaml · yaml-config · bestconfig · HiYaPyCo · hierarchical-conf · HyperPyYAML · simple-settings · yamlloader · confuse