Poyo is a lightweight YAML parser for Python (current version 0.5.0). It focuses on parsing a chosen subset of the YAML format, primarily designed for configuration files like those used by cookiecutter. It explicitly does not support deserialization of arbitrary Python objects, YAML serialization, or JSON compatibility. The project is in maintenance mode with infrequent updates, with the last release in July 2019, but it remains functional for its intended scope.
pip install poyoVerified import paths — ran on the pinned version, not inferred.
Parses a simple YAML string using `parse_string` and demonstrates basic type conversion and multiline string handling, with error handling for parsing issues.
Ensure your YAML adheres to the basic structure supported by Poyo (scalars, lists, dictionaries). For full YAML specification support, consider libraries like PyYAML.
Upgrade to `poyo>=0.3.0` to ensure `~` is correctly parsed as `None`.
Upgrade to `poyo>=0.4.2` to resolve issues with lists containing comments and blank lines.
Upgrade to `poyo>=0.5.0` to use multiline string features. For older versions, represent long strings as single-line quoted strings.
Review the YAML content and simplify it to basic key-value pairs, lists, and scalars. If advanced YAML features are required, switch to a full-featured YAML parser like `PyYAML`.
This often occurs in older versions of poyo. Ensure you are using `poyo>=0.3.0` to correctly handle `null` values. Also, verify that your YAML structure matches the expected Python dictionary access path.
Check for correct YAML indentation and ensure all strings with special characters or spaces are properly quoted. Consider upgrading to the latest Poyo version (`0.5.0`) as several parsing bugs were fixed in later releases.