Skip to content
ASDF Projects Tutorials Community
Back to top
View this page

# dumps

asdf.dumps(tree, *, version=None, extensions=None, all_array_storage=NotSet, all_array_compression=NotSet, compression_kwargs=NotSet, pad_blocks=False, custom_schema=None, write_checksums=True)

  Write tree to a string.

  Parameters:
    tree object

      The tree to dump.

    version str, optional

      Version of the ASDF core schemas to use. If not specified, the default version will be used.

    extensions object, optional

      Additional extensions to use when reading and writing the file. May be an `asdf.extension.Extension` or a `list` of extensions.

    all_array_storage string, optional

      If provided, override the array storage type of all blocks.

    all_array_compression string, optional

      If provided, override the array compression type of all blocks.

    compression_kwargs dict, optional

      If provided, override the compression parameters of all blocks.

    pad_blocks bool, optional

      If provided, pad all blocks to the nearest multiple of the block size.

    custom_schema str, optional

      Path to a custom schema file that will be used for a secondary validation pass. This can be used to ensure that particular ASDF files follow custom conventions beyond those enforced by the specification.

    write_checksums: bool, optional

      Compute and write block checksums to the file.

  Returns:
    str

      The ASDF data as a string.