dump

asdf.dump(tree, fp, *, version=None, extensions=None, all_array_storage=NotSet, all_array_compression=NotSet, compression_kwargs=NotSet, pad_blocks=False, custom_schema=None)[source]

Write a tree to an ASDF file.

Parameters:
treeobject

The tree to dump.

fpstr or file-like object

A file-like object to write the ASDF data to.

versionstr, optional

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

extensionsobject, optional

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

all_array_storagestring, optional

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

all_array_compressionstring, optional

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

compression_kwargsdict, optional

If provided, override the compression parameters of all blocks.

pad_blocksbool, optional

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

custom_schemastr, 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.