--- id: strictyaml version: "1.7.3" license: MIT license_treatment: permissive maintenance: aging --- # strictyaml — Strict, typed YAML parser License: permissive · Maintenance: aging · Popularity: top 1,000 on PyPI ## Install pip install strictyaml uv add strictyaml poetry add strictyaml ## Description # StrictYAML StrictYAML is a [type-safe](https://en.wikipedia.org/wiki/Type_safety) YAML parser that parses and validates a [restricted subset](https://hitchdev.com/strictyaml/features-removed) of the [YAML](https://hitchdev.com/strictyaml/what-is-yaml) specification. Priorities: - Beautiful API - Refusing to parse [the ugly, hard to read and insecure features of YAML](https://hitchdev.com/strictyaml/features-removed) like [the Norway problem](https://hitchdev.com/strictyaml/why/implicit-typing-removed). - Strict validation of markup and straightforward type casting. - Clear, readable exceptions with **code snippets** and **line numbers**. - Acting as a near-drop in replacement for pyyaml, ruamel.yaml or poyo. - Ability to read in YAML, make changes and write it out again with comments preserved. - [Not speed](https://hitchdev.com/strictyaml/why/speed-not-a-priority), currently. Simple example: ```yaml # All about the character name: Ford Prefect age: 42 possessions: - Towel ``` ```python from strictyaml import load, Map, Str, Int, Seq, YAMLError ``` Default parse result: ```python >>> load(yaml_snippet) YAML({'name': 'Ford Prefect', 'age': '42', 'possessions':... ## AI interpretation — verify before relying StrictYAML parses and validates a restricted, type-safe subset of YAML, rejecting unsafe features while preserving comments and line numbers for roundtrip editing. Verdict: StrictYAML is a stable, permissively licensed YAML parser suited for configuration files where safety and schema validation matter more than speed. Aging maintenance (last release 2023-03-10) is acceptable for a mature library, but users should verify it meets their Python version and feature needs before adoption. [View on SkillFed](https://skillfed.io/packages/strictyaml) · [View on PyPI](https://pypi.org/project/strictyaml/)