A full-featured YAML processing framework for Python with optional LibYAML bindings for improved performance.
PyYAML is a YAML processing framework for Python that provides complete parsing and emitting capabilities for YAML data formats. It solves the problem of working with YAML configuration files, data serialization, and complex document structures in Python applications. The library offers both pure Python implementations and optional high-performance C bindings through LibYAML.
Python developers who need to read, write, or manipulate YAML files for configuration, data serialization, or inter-process communication. This includes DevOps engineers, data scientists, and application developers working with YAML-based tools and formats.
Developers choose PyYAML because it provides the most complete YAML 1.1 specification implementation for Python with proven reliability. The optional LibYAML bindings offer significant performance improvements while maintaining the same API, and the safe loading functionality provides security when processing untrusted YAML input.
Canonical source repository for PyYAML
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the full YAML 1.1 specification including advanced features like anchors and aliases, ensuring reliable parsing and emitting of complex documents as stated in the key features.
Offers both pure Python and optional LibYAML C bindings, allowing developers to choose between portability and speed, with installation options detailed in the README.
Provides yaml.safe_load() specifically for parsing YAML from untrusted sources, as recommended in the README to mitigate security risks.
Includes a comprehensive test suite and has been maintained for years, making it a stable choice for production use, as highlighted in the key features.
Only supports YAML 1.1, not the newer YAML 1.2 standard, which can lead to compatibility issues with modern YAML tools and features.
Optimal performance requires LibYAML C bindings, which can be difficult to install on some systems and adds native dependency overhead, as indicated by the installation options in the README.
Without C bindings, the pure Python implementation is significantly slower, making it less suitable for high-throughput scenarios where performance is critical.