write#

lsst.images.json.write(obj: Any, path: str | ParseResult | ResourcePath | Path | None = None, metadata: dict[str, MetadataValue] | None = None, butler_info: ButlerInfo | None = None) ArchiveTree#

Write an object with a serialize method to a JSON file.

Parameters#

path

Name of the file to write to (may be a URI). If not provided, a serializable model is returned but not written to disk.

metadata

Additional metadata to save with the object. This will override any flexible metadata carried by the object itself with the same keys.

butler_info

Butler information to store in the file.

Returns#

serialization.ArchiveTree

The serialized representation of the object.