astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Miscellaneous: HDF5, YAML, ASDF, Parquet, pickle (`astropy.io.misc`) »
- dump

# dump

astropy.io.misc.yaml.dump(data, stream=None, **kwargs)

  Serialize a Python object into a YAML stream using the AstropyDumper class. If stream is None, return the produced string instead.

  Parameters:
    data `object`

      Object to serialize to YAML

    stream python:file-like object, optional

      YAML output (if not supplied a string is returned)

    **kwargs

      Other keyword arguments that get passed to yaml.dump()

  Returns:
    out `python:str` or `python:None`

      If no `stream` is supplied then YAML output is returned as str