Home

PyYAML

PyYAML is a YAML parser and emitter for Python. It provides utilities to parse YAML documents into Python objects and to serialize Python data structures into YAML. The library supports standard YAML features such as mappings, sequences, scalars, anchors, aliases, and tagged values, and can handle multiple documents in a single stream.

PyYAML is implemented as a Python package with optional C speedups via the libyaml project. When the

It offers functions such as safe_load and load for reading YAML, and safe_dump and dump for writing

It is released under the MIT license and is widely used in Python projects for configuration and

PyYAML is maintained as an open-source project and is commonly installed via pip (pip install PyYAML).

C
extension
is
available,
parsing
and
emitting
can
be
substantially
faster,
while
pure-Python
fallback
remains
compatible.
YAML.
Since
loading
YAML
from
untrusted
sources
can
execute
arbitrary
code
when
using
the
default
loader,
modern
usage
recommends
specifying
a
Loader
class
(for
example
SafeLoader
or
FullLoader)
to
control
evaluation
and
improve
security.
data
interchange
that
uses
YAML.